mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
fix path decomposition
This commit is contained in:
@@ -322,7 +322,7 @@ public abstract class AbstractCurvedComponent<T> extends AbstractTransparentComp
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
enum PointCount {
|
public enum PointCount {
|
||||||
TWO(2), THREE(3), FOUR(4), FIVE(5), SEVEN(7);
|
TWO(2), THREE(3), FOUR(4), FIVE(5), SEVEN(7);
|
||||||
|
|
||||||
private int count;
|
private int count;
|
||||||
|
|||||||
Binary file not shown.
@@ -158,6 +158,15 @@ public class TwistedWire extends AbstractCurvedComponent<Void> {
|
|||||||
this.firstLeadArea = null;
|
this.firstLeadArea = null;
|
||||||
this.secondLeadArea = null;
|
this.secondLeadArea = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPointCount(PointCount pointCount) {
|
||||||
|
super.setPointCount(pointCount);
|
||||||
|
|
||||||
|
// invalidate cached areas
|
||||||
|
this.firstLeadArea = null;
|
||||||
|
this.secondLeadArea = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Void getValue() {
|
public Void getValue() {
|
||||||
@@ -186,14 +195,17 @@ public class TwistedWire extends AbstractCurvedComponent<Void> {
|
|||||||
curves.add(new CubicCurve2D.Double(current.x, current.y, (current.x + coords[0]) / 2,
|
curves.add(new CubicCurve2D.Double(current.x, current.y, (current.x + coords[0]) / 2,
|
||||||
(current.y + coords[1]) / 2, (current.x + coords[0]) / 2, (current.y + coords[1]) / 2, coords[0],
|
(current.y + coords[1]) / 2, (current.x + coords[0]) / 2, (current.y + coords[1]) / 2, coords[0],
|
||||||
coords[1]));
|
coords[1]));
|
||||||
|
current.setLocation(coords[0], coords[1]);
|
||||||
break;
|
break;
|
||||||
case PathIterator.SEG_QUADTO:
|
case PathIterator.SEG_QUADTO:
|
||||||
curves.add(new CubicCurve2D.Double(current.x, current.y, coords[0], coords[1], coords[0], coords[1],
|
curves.add(new CubicCurve2D.Double(current.x, current.y, coords[0], coords[1], coords[0], coords[1],
|
||||||
coords[2], coords[3]));
|
coords[2], coords[3]));
|
||||||
|
current.setLocation(coords[2], coords[3]);
|
||||||
break;
|
break;
|
||||||
case PathIterator.SEG_CUBICTO:
|
case PathIterator.SEG_CUBICTO:
|
||||||
curves.add(new CubicCurve2D.Double(current.x, current.y, coords[0], coords[1], coords[2], coords[3],
|
curves.add(new CubicCurve2D.Double(current.x, current.y, coords[0], coords[1], coords[2], coords[3],
|
||||||
coords[4], coords[5]));
|
coords[4], coords[5]));
|
||||||
|
current.setLocation(coords[4], coords[5]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
iterator.next();
|
iterator.next();
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user