mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
better scaling
added marshall board and trimmer
This commit is contained in:
+2
-2
@@ -53,7 +53,7 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
|
||||
* @param x
|
||||
* @return
|
||||
*/
|
||||
protected int getClosestOdd(int x) {
|
||||
return (x / 2) * 2 + 1;
|
||||
protected int getClosestOdd(double x) {
|
||||
return ((int) x / 2) * 2 + 1;
|
||||
}
|
||||
}
|
||||
|
||||
+7
-5
@@ -24,10 +24,12 @@ public abstract class AbstractCurvedComponent<T> extends AbstractTransparentComp
|
||||
public static Color GUIDELINE_COLOR = Color.blue;
|
||||
public static Size DEFAULT_SIZE = new Size(1d, SizeUnit.in);
|
||||
|
||||
protected Point[] controlPoints = new Point[] { new Point(0, 0),
|
||||
new Point(DEFAULT_SIZE.convertToPixels() / 2, 0),
|
||||
new Point(DEFAULT_SIZE.convertToPixels() / 2, DEFAULT_SIZE.convertToPixels()),
|
||||
new Point(DEFAULT_SIZE.convertToPixels(), DEFAULT_SIZE.convertToPixels()) };
|
||||
protected Point[] controlPoints = new Point[] {
|
||||
new Point(0, 0),
|
||||
new Point((int) (DEFAULT_SIZE.convertToPixels() / 2), 0),
|
||||
new Point((int) (DEFAULT_SIZE.convertToPixels() / 2), (int) (DEFAULT_SIZE
|
||||
.convertToPixels())),
|
||||
new Point((int) DEFAULT_SIZE.convertToPixels(), (int) DEFAULT_SIZE.convertToPixels()) };
|
||||
|
||||
protected Color color = getDefaultColor();
|
||||
|
||||
@@ -107,7 +109,7 @@ public abstract class AbstractCurvedComponent<T> extends AbstractTransparentComp
|
||||
public VisibilityPolicy getControlPointVisibilityPolicy(int index) {
|
||||
return VisibilityPolicy.WHEN_SELECTED;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canControlPointOverlap(int index) {
|
||||
// Only shape control points may overlap.
|
||||
|
||||
+2
-2
@@ -40,7 +40,7 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
||||
protected Size width;
|
||||
protected Point[] points = new Point[] {
|
||||
new Point((int) (-DEFAULT_SIZE.convertToPixels() / 2), 0),
|
||||
new Point(DEFAULT_SIZE.convertToPixels() / 2, 0) };
|
||||
new Point((int) (DEFAULT_SIZE.convertToPixels() / 2), 0) };
|
||||
protected Color bodyColor = Color.white;
|
||||
protected Color borderColor = Color.black;
|
||||
protected Color labelColor = LABEL_COLOR;
|
||||
@@ -173,7 +173,7 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
||||
* @return default lead thickness. Override this method to change it.
|
||||
*/
|
||||
protected int getLeadThickness() {
|
||||
return LEAD_THICKNESS.convertToPixels();
|
||||
return (int) LEAD_THICKNESS.convertToPixels();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user