mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Trace cuts can be placed between two holes for tighter layouts
This commit is contained in:
Binary file not shown.
+12
-3
@@ -34,7 +34,7 @@ public class TraceCut extends AbstractComponent<Void> {
|
|||||||
private Color fillColor = FILL_COLOR;
|
private Color fillColor = FILL_COLOR;
|
||||||
private Color borderColor = BORDER_COLOR;
|
private Color borderColor = BORDER_COLOR;
|
||||||
private Color boardColor = AbstractBoard.BOARD_COLOR;
|
private Color boardColor = AbstractBoard.BOARD_COLOR;
|
||||||
private boolean cutBetweenHoles = false;
|
private Boolean cutBetweenHoles = true;
|
||||||
private Size holeSpacing = VeroBoard.SPACING;
|
private Size holeSpacing = VeroBoard.SPACING;
|
||||||
|
|
||||||
protected Point point = new Point(0, 0);
|
protected Point point = new Point(0, 0);
|
||||||
@@ -47,9 +47,9 @@ public class TraceCut extends AbstractComponent<Void> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int size = getClosestOdd((int) this.size.convertToPixels());
|
int size = getClosestOdd((int) this.size.convertToPixels());
|
||||||
int holeSpacing = getClosestOdd(this.holeSpacing.convertToPixels());
|
|
||||||
int cutWidth = getClosestOdd((int) CUT_WIDTH.convertToPixels());
|
int cutWidth = getClosestOdd((int) CUT_WIDTH.convertToPixels());
|
||||||
if (cutBetweenHoles) {
|
if (getCutBetweenHoles()) {
|
||||||
|
int holeSpacing = getClosestOdd(getHoleSpacing().convertToPixels());
|
||||||
g2d
|
g2d
|
||||||
.setColor(componentState == ComponentState.SELECTED
|
.setColor(componentState == ComponentState.SELECTED
|
||||||
|| componentState == ComponentState.DRAGGING ? SELECTION_COLOR
|
|| componentState == ComponentState.DRAGGING ? SELECTION_COLOR
|
||||||
@@ -147,6 +147,9 @@ public class TraceCut extends AbstractComponent<Void> {
|
|||||||
|
|
||||||
@EditableProperty(name = "Cut between holes")
|
@EditableProperty(name = "Cut between holes")
|
||||||
public boolean getCutBetweenHoles() {
|
public boolean getCutBetweenHoles() {
|
||||||
|
if (cutBetweenHoles == null) {
|
||||||
|
cutBetweenHoles = false;
|
||||||
|
}
|
||||||
return cutBetweenHoles;
|
return cutBetweenHoles;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,6 +159,9 @@ public class TraceCut extends AbstractComponent<Void> {
|
|||||||
|
|
||||||
@EditableProperty(name = "Board")
|
@EditableProperty(name = "Board")
|
||||||
public Color getBoardColor() {
|
public Color getBoardColor() {
|
||||||
|
if (boardColor == null) {
|
||||||
|
boardColor = AbstractBoard.BOARD_COLOR;
|
||||||
|
}
|
||||||
return boardColor;
|
return boardColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,6 +171,9 @@ public class TraceCut extends AbstractComponent<Void> {
|
|||||||
|
|
||||||
@EditableProperty(name = "Hole spacing")
|
@EditableProperty(name = "Hole spacing")
|
||||||
public Size getHoleSpacing() {
|
public Size getHoleSpacing() {
|
||||||
|
if (holeSpacing == null) {
|
||||||
|
holeSpacing = VeroBoard.SPACING;
|
||||||
|
}
|
||||||
return holeSpacing;
|
return holeSpacing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user