screen marker overlay: stop if preferred size is null

If the overlay renderer has no size saved in the config this can happen
This commit is contained in:
Adam
2018-05-27 19:01:59 -04:00
parent 1526141123
commit a39967520a

View File

@@ -63,11 +63,18 @@ public class ScreenMarkerOverlay extends Overlay
return null;
}
Dimension preferredSize = getPreferredSize();
if (preferredSize == null)
{
// overlay has no preferred size in the renderer configuration!
return null;
}
screenMarkerRenderable.setBorderThickness(marker.getBorderThickness());
screenMarkerRenderable.setColor(marker.getColor());
screenMarkerRenderable.setFill(marker.getFill());
screenMarkerRenderable.setStroke(new BasicStroke(marker.getBorderThickness()));
screenMarkerRenderable.setPreferredSize(getPreferredSize());
screenMarkerRenderable.setPreferredSize(preferredSize);
return screenMarkerRenderable.render(graphics);
}
}