Mir

Code review comment for lp:~andreas-pokorny/mir/cursor-position-on-rotated-output

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

25 + case mir_orientation_left:
26 + return {vector.dy.as_int(), rect.size.width.as_int() -vector.dx.as_int()};
27 + case mir_orientation_inverted:
28 + return {rect.size.width.as_int() -vector.dx.as_int(), rect.size.height.as_int() - vector.dy.as_int()};
29 + case mir_orientation_right:
30 + return {rect.size.height.as_int() -vector.dy.as_int(), vector.dx.as_int()};

Maybe it is time we added enough matrix algebra to our geometry component to write:

   return geom::rotate(geom::degrees(90)) * vector;

etc. And stopped writing as_int() all over the domain code.

review: Approve

« Back to merge proposal