double counterExpansion = 0.001;
double x = boundsInLocal.getX() + counterExpansion;
double y = boundsInLocal.getY() + counterExpansion;
- double scaledWidth = boundsInLocal.getWidth() / canvasTransform.getScaleX() / 10000.0;
- double scaledHeight = boundsInLocal.getHeight() / canvasTransform.getScaleY() / 10000.0;
+ double scaledWidth = boundsInLocal.getWidth();
+ double scaledHeight = boundsInLocal.getHeight();
+ if (canvasTransform != null) {
+ scaledWidth = boundsInLocal.getWidth() / canvasTransform.getScaleX() / 10000.0;
+ scaledHeight= boundsInLocal.getHeight() / canvasTransform.getScaleY() / 10000.0;
+ }
double width = scaledWidth - 2*counterExpansion;
double height = scaledHeight - 2*counterExpansion;
size.setFrame(x, y, width, height);