mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +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);
|
||||
|
||||
private int count;
|
||||
|
||||
Binary file not shown.
@@ -159,6 +159,15 @@ public class TwistedWire extends AbstractCurvedComponent<Void> {
|
||||
this.secondLeadArea = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointCount(PointCount pointCount) {
|
||||
super.setPointCount(pointCount);
|
||||
|
||||
// invalidate cached areas
|
||||
this.firstLeadArea = null;
|
||||
this.secondLeadArea = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void getValue() {
|
||||
return null;
|
||||
@@ -186,14 +195,17 @@ public class TwistedWire extends AbstractCurvedComponent<Void> {
|
||||
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],
|
||||
coords[1]));
|
||||
current.setLocation(coords[0], coords[1]);
|
||||
break;
|
||||
case PathIterator.SEG_QUADTO:
|
||||
curves.add(new CubicCurve2D.Double(current.x, current.y, coords[0], coords[1], coords[0], coords[1],
|
||||
coords[2], coords[3]));
|
||||
current.setLocation(coords[2], coords[3]);
|
||||
break;
|
||||
case PathIterator.SEG_CUBICTO:
|
||||
curves.add(new CubicCurve2D.Double(current.x, current.y, coords[0], coords[1], coords[2], coords[3],
|
||||
coords[4], coords[5]));
|
||||
current.setLocation(coords[4], coords[5]);
|
||||
break;
|
||||
}
|
||||
iterator.next();
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user