View: provide the transform between different coordinate spaces

There's currently no way for an application to convert between view and
drawing coordinates with a drawing states stack without keeping track of
all the transformations itself, which is not very convenient for helper
or library functions.

Handle other spaces too, for good measure.

Change-Id: Ic8404a1c111e273fff1eebf2f9f59f58246b796c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5775
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Máximo Castañeda
2022-11-13 04:04:30 +00:00
committed by waddlesplash
parent 423e3645e1
commit 241f109ccb
7 changed files with 199 additions and 4 deletions
+1 -3
View File
@@ -66,7 +66,5 @@
All drawing operations in a BView use coordinates specified in the drawing space.
However, the update rect passed to the Draw method (or passed to the Invalidate
method) is in the BView base coordinate space. Conversion between the two can
be done using the affine transform returned by BView::Transform, or in case the
legacy transformation functions are used, by applying the scale and origin returned
by the Scale() and Origin() functions.
be done using the affine transform returned by BView::TransformTo.
*/