overlay renderer: fix drawing overlay drag bounds

The graphics transform needs to be reset prior to drawing the overlay
bounds
This commit is contained in:
Adam
2019-08-16 09:27:05 -04:00
parent ea85b64fc7
commit 799a8943d3

View File

@@ -240,6 +240,14 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
if (overlayPosition == OverlayPosition.DYNAMIC || overlayPosition == OverlayPosition.TOOLTIP)
{
safeRender(client, overlay, layer, graphics, new Point());
// Restore graphics2d properties
graphics.setTransform(transform);
graphics.setStroke(stroke);
graphics.setComposite(composite);
graphics.setPaint(paint);
graphics.setRenderingHints(renderingHints);
graphics.setBackground(background);
}
else
{
@@ -276,6 +284,14 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
safeRender(client, overlay, layer, graphics, location);
// Restore graphics2d properties prior to drawing bounds
graphics.setTransform(transform);
graphics.setStroke(stroke);
graphics.setComposite(composite);
graphics.setPaint(paint);
graphics.setRenderingHints(renderingHints);
graphics.setBackground(background);
final Rectangle bounds = overlay.getBounds();
if (!bounds.isEmpty())
@@ -294,14 +310,6 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
}
}
}
// Restore graphics2d properties
graphics.setTransform(transform);
graphics.setStroke(stroke);
graphics.setComposite(composite);
graphics.setPaint(paint);
graphics.setRenderingHints(renderingHints);
graphics.setBackground(background);
}
}