mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Some boards (e.g. Breadboard) stop working at certain orientations
This commit is contained in:
@@ -3042,6 +3042,10 @@
|
|||||||
<releaseDate>2020-04-20 00:00:00.000 CET</releaseDate>
|
<releaseDate>2020-04-20 00:00:00.000 CET</releaseDate>
|
||||||
<name></name>
|
<name></name>
|
||||||
<changes>
|
<changes>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>BUG_FIX</changeType>
|
||||||
|
<description>Some boards (e.g. Breadboard) stop working at certain orientations</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>BUG_FIX</changeType>
|
<changeType>BUG_FIX</changeType>
|
||||||
<description>Component leads on resistors, capacitors, etc disappear when they are very short</description>
|
<description>Component leads on resistors, capacitors, etc disappear when they are very short</description>
|
||||||
|
|||||||
@@ -337,7 +337,8 @@ public abstract class AbstractBoard extends AbstractTransparentComponent<String>
|
|||||||
@Override
|
@Override
|
||||||
public Rectangle2D getCachingBounds() {
|
public Rectangle2D getCachingBounds() {
|
||||||
Point finalSecondPoint = getFinalSecondPoint();
|
Point finalSecondPoint = getFinalSecondPoint();
|
||||||
return new Rectangle2D.Double(firstPoint.x, firstPoint.y, finalSecondPoint.x - firstPoint.x + 1, finalSecondPoint.y - firstPoint.y + 1);
|
return new Rectangle2D.Double(Math.min(firstPoint.x, finalSecondPoint.x), Math.min(firstPoint.y, finalSecondPoint.y),
|
||||||
|
Math.abs(finalSecondPoint.x - firstPoint.x) + 2, Math.abs(finalSecondPoint.y - firstPoint.y) + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum CoordinateType {
|
public static enum CoordinateType {
|
||||||
|
|||||||
@@ -382,7 +382,8 @@ public class Breadboard extends AbstractComponent<Void> {
|
|||||||
@Override
|
@Override
|
||||||
public Rectangle2D getCachingBounds() {
|
public Rectangle2D getCachingBounds() {
|
||||||
Point finalSecondPoint = getControlPoint(1);
|
Point finalSecondPoint = getControlPoint(1);
|
||||||
return new Rectangle2D.Double(point.x, point.y, finalSecondPoint.x - point.x + 1, finalSecondPoint.y - point.y + 1);
|
return new Rectangle2D.Double(Math.min(point.x, finalSecondPoint.x), Math.min(point.y, finalSecondPoint.y),
|
||||||
|
Math.abs(finalSecondPoint.x - point.x) + 2, Math.abs(finalSecondPoint.y - point.y) + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum BreadboardSize {
|
public enum BreadboardSize {
|
||||||
|
|||||||
@@ -700,6 +700,7 @@ public class ProtoBoard extends AbstractComponent<Void> {
|
|||||||
@Override
|
@Override
|
||||||
public Rectangle2D getCachingBounds() {
|
public Rectangle2D getCachingBounds() {
|
||||||
Point finalSecondPoint = getControlPoint(1);
|
Point finalSecondPoint = getControlPoint(1);
|
||||||
return new Rectangle2D.Double(point.x, point.y, finalSecondPoint.x - point.x + 1, finalSecondPoint.y - point.y + 1);
|
return new Rectangle2D.Double(Math.min(point.x, finalSecondPoint.x), Math.min(point.y, finalSecondPoint.y),
|
||||||
|
Math.abs(finalSecondPoint.x - point.x) + 2, Math.abs(finalSecondPoint.y - point.y) + 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user