Replies: 1 comment
-
I think you can use transpose to flip coordinates. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I ported some code from using System.Drawing.Drawing2d.Matrix to using SkiaSharp.
However, a bunch of unit tests failed because it seems that the library assumes that every asset and every drawing surface is top left based (that the "0,0" coordinate is top left and that Y coordinates increase as you move down on screen.
The fallout from this is that assets represented in Carthesian coordinates ("Top" > "Bottom") are showing negative Height.
Another, more major, problem is that the SKRect is standardized unpredictably.
If I have a SKRect instance with Top=20 and Bottom=10, and then I do a
MyRect = SKMatrix.CreateIdentity().MapRect(MyRect);
... then this will switch the Bottom and Top properties returning the "Standardized" version of the rectangle.
This also has the side effect that applying TranformationMatrix1 and applying TransformationMatrix2 will not equal applying their concatenation since the first transformation may decide to standardize the intermediate result.
Do any of you know of a .NetStandard20 library that implement matrix and doesn't care about y coordinates being positive up/down (or at least lets you opt out of its side effects)?
Beta Was this translation helpful? Give feedback.
All reactions