mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Large components disappear when none of the edges is in the visible area
This commit is contained in:
Binary file not shown.
+17
@@ -1,8 +1,12 @@
|
|||||||
package org.diylc.components.boards;
|
package org.diylc.components.boards;
|
||||||
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
|
import java.awt.Shape;
|
||||||
|
|
||||||
|
import org.diylc.core.ComponentState;
|
||||||
import org.diylc.core.IDIYComponent;
|
import org.diylc.core.IDIYComponent;
|
||||||
|
import org.diylc.core.IDrawingObserver;
|
||||||
|
import org.diylc.core.Project;
|
||||||
import org.diylc.core.annotations.BomPolicy;
|
import org.diylc.core.annotations.BomPolicy;
|
||||||
import org.diylc.core.annotations.ComponentDescriptor;
|
import org.diylc.core.annotations.ComponentDescriptor;
|
||||||
|
|
||||||
@@ -20,6 +24,19 @@ public class BlankBoard extends AbstractBoard {
|
|||||||
g2d.drawRect(2 / factor, 2 / factor, width - 4 / factor, height - 4 / factor);
|
g2d.drawRect(2 / factor, 2 / factor, width - 4 / factor, height - 4 / factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(Graphics2D g2d, ComponentState componentState,
|
||||||
|
boolean outlineMode, Project project,
|
||||||
|
IDrawingObserver drawingObserver) {
|
||||||
|
Shape clip = g2d.getClip();
|
||||||
|
if (checkPointsClipped(clip)
|
||||||
|
&& !clip.contains(firstPoint.x, secondPoint.y)
|
||||||
|
&& !clip.contains(secondPoint.x, firstPoint.y)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.draw(g2d, componentState, outlineMode, project, drawingObserver);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getDrawCoordinates() {
|
public boolean getDrawCoordinates() {
|
||||||
// Override to prevent editing.
|
// Override to prevent editing.
|
||||||
|
|||||||
Reference in New Issue
Block a user