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.
@@ -293,8 +293,16 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
||||
private void drawLead(Graphics2D g2d, ComponentState componentState, IDrawingObserver observer, boolean isCopperArea) {
|
||||
if (isCopperArea)
|
||||
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;
|
||||
switch (getStyle()) {
|
||||
case SOLID:
|
||||
@@ -308,23 +316,24 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
||||
stroke = ObjectCache.getInstance().fetchStroke(thickness, new float[] {thickness / 4, thickness * 4}, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
Line2D line = new Line2D.Double(points[0].x, points[0].y, points[1].x, points[1].y);
|
||||
Shape lineShape = stroke.createStrokedShape(line);
|
||||
|
||||
Color leadColor =
|
||||
shouldShadeLeads() ? getLeadColorForPainting(componentState) : getLeadColorForPainting(componentState);
|
||||
g2d.setColor(leadColor);
|
||||
g2d.fill(lineShape);
|
||||
|
||||
if (isCopperArea)
|
||||
observer.stopTrackingContinuityArea();
|
||||
|
||||
if (shouldShadeLeads()) {
|
||||
if (shouldShadeLeads()) {
|
||||
Shape lineShape = stroke.createStrokedShape(line);
|
||||
|
||||
g2d.setColor(getLeadColorForPainting(componentState));
|
||||
g2d.fill(lineShape);
|
||||
|
||||
if (isCopperArea)
|
||||
observer.stopTrackingContinuityArea();
|
||||
|
||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1f));
|
||||
leadColor = getLeadColorForPainting(componentState);
|
||||
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>
|
||||
<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>
|
||||
<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>
|
||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||
</org.diylc.appframework.update.Version>
|
||||
|
||||
Reference in New Issue
Block a user