public void render(Graphics2D g) {
if (!enabled)
return;
-
+
AffineTransform tr = g.getTransform();
double scaleX = Math.abs(tr.getScaleX());
double scaleY = Math.abs(tr.getScaleY());
// Vertical ruler
for(double x = offsetX%stepX-stepX; x < bounds.getMaxX(); x+=stepX) {
if(x > 20) {
- double val = (x-offsetX)/scaleX;
+ double val = (x-offsetX)/scaleX / getTransform().getScaleX();
double modifiedValue = modifyHorizontalValue(val);
String str = formatValue(modifiedValue);
FontMetrics fm = g.getFontMetrics();
previousText = -100;
for(double y = offsetY%stepY-stepY; y < bounds.getMaxY(); y+=stepY) {
if(y > 20) {
- double val = (y-offsetY)/scaleY;
+ double val = (y-offsetY)/scaleY / getTransform().getScaleY();
double modifiedValue = modifyVerticalValue(val);
String str = formatValue(modifiedValue);
FontMetrics fm = g.getFontMetrics();