mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Solder Pad size shouldn't be rounded up or down to the nearest integer
to allow better precision
This commit is contained in:
Binary file not shown.
@@ -3,6 +3,8 @@ package org.diylc.components.connectivity;
|
|||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
|
import java.awt.geom.Ellipse2D;
|
||||||
|
import java.awt.geom.Rectangle2D;
|
||||||
|
|
||||||
import org.diylc.common.PCBLayer;
|
import org.diylc.common.PCBLayer;
|
||||||
import org.diylc.common.SimpleComponentTransformer;
|
import org.diylc.common.SimpleComponentTransformer;
|
||||||
@@ -46,18 +48,18 @@ public class SolderPad extends AbstractComponent<Void> {
|
|||||||
if (checkPointsClipped(g2d.getClip())) {
|
if (checkPointsClipped(g2d.getClip())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int diameter = getClosestOdd((int) getSize().convertToPixels());
|
double diameter = getSize().convertToPixels();
|
||||||
int holeDiameter = getClosestOdd((int) getHoleSize().convertToPixels());
|
double holeDiameter = getHoleSize().convertToPixels();
|
||||||
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
|
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
|
||||||
: color);
|
: color);
|
||||||
if (type == Type.ROUND) {
|
if (type == Type.ROUND) {
|
||||||
g2d.fillOval(point.x - diameter / 2, point.y - diameter / 2, diameter, diameter);
|
g2d.fill(new Ellipse2D.Double(point.x - diameter / 2, point.y - diameter / 2, diameter, diameter));
|
||||||
} else {
|
} else {
|
||||||
g2d.fillRect(point.x - diameter / 2, point.y - diameter / 2, diameter, diameter);
|
g2d.fill(new Rectangle2D.Double(point.x - diameter / 2, point.y - diameter / 2, diameter, diameter));
|
||||||
}
|
}
|
||||||
if (getHoleSize().getValue() > 0) {
|
if (getHoleSize().getValue() > 0) {
|
||||||
g2d.setColor(Constants.CANVAS_COLOR);
|
g2d.setColor(Constants.CANVAS_COLOR);
|
||||||
g2d.fillOval(point.x - holeDiameter / 2, point.y - holeDiameter / 2, holeDiameter, holeDiameter);
|
g2d.fill(new Ellipse2D.Double(point.x - holeDiameter / 2, point.y - holeDiameter / 2, holeDiameter, holeDiameter));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1706,6 +1706,10 @@
|
|||||||
<changeType>NEW_FEATURE</changeType>
|
<changeType>NEW_FEATURE</changeType>
|
||||||
<description>Red ticks on both rulers mark selection bounds, blue tick tracks cursor position</description>
|
<description>Red ticks on both rulers mark selection bounds, blue tick tracks cursor position</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
<description>Solder Pad size shouldn't be rounded up or down to the nearest integer to allow better precision</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>Issues with DIL and SIL IC pin alignment when using metric grid and pin spacing</description>
|
<description>Issues with DIL and SIL IC pin alignment when using metric grid and pin spacing</description>
|
||||||
|
|||||||
Reference in New Issue
Block a user