mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
fix: straight traces are rendered 1px thinner than curved traces of the
same thickness
This commit is contained in:
Binary file not shown.
@@ -294,7 +294,15 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
|||||||
if (isCopperArea)
|
if (isCopperArea)
|
||||||
observer.startTrackingContinuityArea(true);
|
observer.startTrackingContinuityArea(true);
|
||||||
|
|
||||||
float thickness = getLeadThickness() - 1;
|
float thickness = getLeadThickness();
|
||||||
|
|
||||||
|
Line2D line = new Line2D.Double(points[0].x, points[0].y, points[1].x, points[1].y);
|
||||||
|
|
||||||
|
if (shouldShadeLeads()) {
|
||||||
|
// for some reason the stroked line gets approx 1px thicker when converted to shape
|
||||||
|
thickness -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
Stroke stroke = null;
|
Stroke stroke = null;
|
||||||
switch (getStyle()) {
|
switch (getStyle()) {
|
||||||
case SOLID:
|
case SOLID:
|
||||||
@@ -309,22 +317,23 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Line2D line = new Line2D.Double(points[0].x, points[0].y, points[1].x, points[1].y);
|
if (shouldShadeLeads()) {
|
||||||
Shape lineShape = stroke.createStrokedShape(line);
|
Shape lineShape = stroke.createStrokedShape(line);
|
||||||
|
|
||||||
Color leadColor =
|
g2d.setColor(getLeadColorForPainting(componentState));
|
||||||
shouldShadeLeads() ? getLeadColorForPainting(componentState) : getLeadColorForPainting(componentState);
|
|
||||||
g2d.setColor(leadColor);
|
|
||||||
g2d.fill(lineShape);
|
g2d.fill(lineShape);
|
||||||
|
|
||||||
if (isCopperArea)
|
if (isCopperArea)
|
||||||
observer.stopTrackingContinuityArea();
|
observer.stopTrackingContinuityArea();
|
||||||
|
|
||||||
if (shouldShadeLeads()) {
|
|
||||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1f));
|
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1f));
|
||||||
leadColor = getLeadColorForPainting(componentState);
|
leadColor = getLeadColorForPainting(componentState);
|
||||||
g2d.setColor(leadColor.darker());
|
g2d.setColor(leadColor.darker());
|
||||||
g2d.draw(lineShape);
|
g2d.draw(lineShape);
|
||||||
|
} else {
|
||||||
|
g2d.setColor(getLeadColorForPainting(componentState));
|
||||||
|
g2d.setStroke(stroke);
|
||||||
|
g2d.draw(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -2290,6 +2290,10 @@
|
|||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
<description>Chrome-style cursors for mouse scrolling with arrows showing the exact scrolling direction</description>
|
<description>Chrome-style cursors for mouse scrolling with arrows showing the exact scrolling direction</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>BUG_FIX</changeType>
|
||||||
|
<description>Since 3.49, straight traces are rendered 1px thinner than curved traces of the same thickness</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
</changes>
|
</changes>
|
||||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||||
</org.diylc.appframework.update.Version>
|
</org.diylc.appframework.update.Version>
|
||||||
|
|||||||
Reference in New Issue
Block a user