|
|
@ -114,10 +114,12 @@ public abstract class BlockCreator<T extends TemplateBlock> extends JComponent i |
|
|
|
public Rectangle getEditorBounds() { |
|
|
|
public Rectangle getEditorBounds() { |
|
|
|
Rectangle bounds = this.getBounds(); |
|
|
|
Rectangle bounds = this.getBounds(); |
|
|
|
Dimension d = getEditor().getCornerSize(); |
|
|
|
Dimension d = getEditor().getCornerSize(); |
|
|
|
bounds.x -= d.width + designer.getHorizontalValue(); |
|
|
|
//ECBlockCreator缩放的时候边框需要重新算下
|
|
|
|
bounds.y -= d.height + designer.getVerticalValue(); |
|
|
|
double times = this.designer.getResolution() / (double)resolution; |
|
|
|
bounds.width += d.width + PolyConstants.OPERATION_SIZE; |
|
|
|
bounds.x -= d.width/times + designer.getHorizontalValue(); |
|
|
|
bounds.height += d.height + PolyConstants.OPERATION_SIZE; |
|
|
|
bounds.y -= d.height/times + designer.getVerticalValue(); |
|
|
|
|
|
|
|
bounds.width += Math.ceil(d.width/times + PolyConstants.OPERATION_SIZE/times); |
|
|
|
|
|
|
|
bounds.height += Math.ceil(d.height/times + PolyConstants.OPERATION_SIZE/times); |
|
|
|
return bounds; |
|
|
|
return bounds; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|