-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inverse Matrix #35
Comments
I have added an example code to do the hit-test using an inverse transformation. I think an common method is to make objects have transform property and its inverse. e.g.:
To draw the object: g.setTransform(obj.Transform);
g.drawRect(...); To hit-test point: var transformedPoint = obj.InverseTransform.TransformPoint(p);
bool isHitted = rect.ContainsPoint(transformedPoint); I have also added two new APIs Here is the example code |
Working like a charm ! Thanks |
Is it possible to invert matrix ? ( C# lib ). Actually i'm drawing rectangles, and using Translate and Scale to allow Pan & Zoom. Thats working, but i can't calculate mouse position because the rectangles positions changed via the Matrix translate but there is no way to also translate mouse pos (or i didn't find how).
The text was updated successfully, but these errors were encountered: