Permalink
Browse files

GraphicsUtils.fillPaintedShape() deosn't fill shapes without area.

  • Loading branch information...
eseifert committed Aug 3, 2017
1 parent 4cc753f commit 1c4d126bec371b4bae95cb58f4c0836f3ceec2fe
Showing with 3 additions and 0 deletions.
  1. +3 −0 gral-core/src/main/java/de/erichseifert/gral/util/GraphicsUtils.java
@@ -171,6 +171,9 @@ public static void fillPaintedShape(Graphics2D graphics, Shape shape,
if (paintBounds == null) {
paintBounds = shape.getBounds2D();
}
if (paintBounds.getWidth() == 0.0 || paintBounds.getHeight() == 0.0) {
return;
}
AffineTransform txOrig = graphics.getTransform();
graphics.translate(paintBounds.getX(), paintBounds.getY());
graphics.scale(paintBounds.getWidth(), paintBounds.getHeight());

0 comments on commit 1c4d126

Please sign in to comment.