mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
fixed lead alignment issue
This commit is contained in:
+6
-4
@@ -121,10 +121,12 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
|||||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(leadThickness));
|
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(leadThickness));
|
||||||
g2d.setColor(shouldShadeLeads() ? getLeadColor(componentState).darker()
|
g2d.setColor(shouldShadeLeads() ? getLeadColor(componentState).darker()
|
||||||
: getLeadColor(componentState));
|
: getLeadColor(componentState));
|
||||||
g2d.drawLine(points[0].x, points[0].y, (int) (points[0].x + Math.cos(theta) * leadLength),
|
int endX = (int) (points[0].x + Math.cos(theta) * leadLength);
|
||||||
(int) (points[0].y + Math.sin(theta) * leadLength));
|
int endY = (int) Math.round(points[0].y + Math.sin(theta) * leadLength);
|
||||||
g2d.drawLine(points[1].x, points[1].y, (int) (points[1].x + Math.cos(theta - Math.PI)
|
g2d.drawLine(points[0].x, points[0].y, endX, endY);
|
||||||
* leadLength), (int) (points[1].y + Math.sin(theta - Math.PI) * leadLength));
|
endX = (int) (points[1].x + Math.cos(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);
|
||||||
if (shouldShadeLeads()) {
|
if (shouldShadeLeads()) {
|
||||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(leadThickness - 2));
|
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(leadThickness - 2));
|
||||||
g2d.setColor(getLeadColor(componentState));
|
g2d.setColor(getLeadColor(componentState));
|
||||||
|
|||||||
Reference in New Issue
Block a user