fix cache for proto board and breadboard

This commit is contained in:
bancika
2020-04-11 17:19:16 +02:00
parent b8e64334bb
commit a0611fa727
3 changed files with 23 additions and 1 deletions
@@ -27,6 +27,7 @@ import java.awt.Composite;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import org.diylc.awt.StringUtils;
import org.diylc.common.HorizontalAlignment;
@@ -376,6 +377,12 @@ public class Breadboard extends AbstractComponent<Void> {
@Override
public String getControlPointNodeName(int index) {
return null;
}
@Override
public Rectangle2D getCachingBounds() {
Point finalSecondPoint = getControlPoint(1);
return new Rectangle2D.Double(point.x, point.y, finalSecondPoint.x - point.x + 1, finalSecondPoint.y - point.y + 1);
}
public enum BreadboardSize {
@@ -25,6 +25,7 @@ import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import org.diylc.awt.StringUtils;
import org.diylc.common.HorizontalAlignment;
@@ -694,5 +695,11 @@ public class ProtoBoard extends AbstractComponent<Void> {
@Override
public String getControlPointNodeName(int index) {
return null;
}
@Override
public Rectangle2D getCachingBounds() {
Point finalSecondPoint = getControlPoint(1);
return new Rectangle2D.Double(point.x, point.y, finalSecondPoint.x - point.x + 1, finalSecondPoint.y - point.y + 1);
}
}