Lead alignment sometimes gets rendered off by 1px for resistor and

capacitor schematic symbol
This commit is contained in:
Branislav Stojkovic
2019-01-28 11:32:34 +01:00
parent d5f3457c43
commit 4d3f2968c1
3 changed files with 8 additions and 4 deletions
@@ -293,12 +293,12 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
} }
private void drawLeads(Graphics2D g2d, double theta, double leadLength) { private void drawLeads(Graphics2D g2d, double theta, double leadLength) {
int endX = (int) (points[0].x + Math.cos(theta) * leadLength); int endX = (int) Math.round(points[0].x + Math.cos(theta) * leadLength);
int endY = (int) (points[0].y + Math.sin(theta) * leadLength); int endY = (int) Math.round(points[0].y + Math.sin(theta) * leadLength);
g2d.drawLine(points[0].x, points[0].y, endX, endY); g2d.drawLine(points[0].x, points[0].y, endX, endY);
endX = (int) (points[1].x + Math.cos(theta - Math.PI) * leadLength); endX = (int) Math.round(points[1].x + Math.cos(theta - Math.PI) * leadLength);
endY = (int) (points[1].y + Math.sin(theta - Math.PI) * leadLength); endY = (int) Math.round(points[1].y + Math.sin(theta - Math.PI) * leadLength);
g2d.drawLine(points[1].x, points[1].y, endX, endY); g2d.drawLine(points[1].x, points[1].y, endX, endY);
} }
Binary file not shown.
+4
View File
@@ -2334,6 +2334,10 @@
<changeType>BUG_FIX</changeType> <changeType>BUG_FIX</changeType>
<description>Jumper color switches to red on its own</description> <description>Jumper color switches to red on its own</description>
</org.diylc.appframework.update.Change> </org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType>
<description>Lead alignment sometimes gets rendered off by 1px for resistor and capacitor schematic symbol</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType> <changeType>BUG_FIX</changeType>
<description>Reverted Ohm symbol changes that made it render wrong on some systems</description> <description>Reverted Ohm symbol changes that made it render wrong on some systems</description>