That looks better yes; it's still a bit complex IMO, but I'm not sure it's possible to do much better with that glyph index thing. Still I'm wondering if you shouldn't do the IsRectEmpty check after the LPtoDP and coordinates swap.
It looks to me like LPtoDP is just doing a linear transform, so the area should be preserved - the rectangle should be empty after the transform if and only if it is empty before the transform.
Or am I missing something? Is there another reason to move the IsRectEmpty check after the transform?
Warren
Warren_Baird@cimmetry.com writes:
It looks to me like LPtoDP is just doing a linear transform, so the area should be preserved - the rectangle should be empty after the transform if and only if it is empty before the transform.
Or am I missing something? Is there another reason to move the IsRectEmpty check after the transform?
There can be rounding issues, if multiple logical pixels correspond to a single physical pixel. Also there are sign issues, IsRectEmpty will return TRUE for left >= right which is why it's better to check after the coordinate swap.