Previously, the calculation of minX, minY, maxX, and maxY inside jswrap_graphics_drawString was what graphicsToDeviceCoordinates does, just written out explicitly. With 90- or 270-degree rotations, that meant that the final values ended up rotated 180 degrees relative to what they should have been. As a result, characters could end up effectively clipped twice and hence incorrectly not being drawn. What we actually want instead is to do the reverse transformation of graphicsToDeviceCoordinates, which fortunately already exists as deviceToGraphicsCoordinates.
The PR includes a test that would fail before and is fixed by this change.
Thanks - this looks great! I was sure there was a reason it was done that way, but I can't remember now - maybe it's just that deviceToGraphicsCoordinates didn't exist at the time or I'd forgotten about it...
Previously, the calculation of
minX
,minY
,maxX
, andmaxY
insidejswrap_graphics_drawString
was whatgraphicsToDeviceCoordinates
does, just written out explicitly. With 90- or 270-degree rotations, that meant that the final values ended up rotated 180 degrees relative to what they should have been. As a result, characters could end up effectively clipped twice and hence incorrectly not being drawn. What we actually want instead is to do the reverse transformation ofgraphicsToDeviceCoordinates
, which fortunately already exists asdeviceToGraphicsCoordinates
.The PR includes a test that would fail before and is fixed by this change.