mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
fix IC pin alignment issue
This commit is contained in:
@@ -210,7 +210,7 @@ public class DrawingManager {
|
||||
failedComponents.add(component);
|
||||
}
|
||||
Area area = g2dWrapper.finishedDrawingComponent();
|
||||
if (trackArea && area != null && !area.isEmpty()) {
|
||||
if (trackArea && area != null && !area.isEmpty()) {
|
||||
componentAreaMap.put(component, area);
|
||||
lastDrawnStateMap.put(component, state);
|
||||
}
|
||||
|
||||
@@ -438,7 +438,8 @@ class G2DWrapper extends Graphics2D implements IDrawingObserver {
|
||||
public void setStroke(Stroke s) {
|
||||
if (this.zoom > 1 && s.getClass() == BasicStroke.class) {
|
||||
BasicStroke bs = (BasicStroke) s;
|
||||
if (bs.getLineWidth() == 1)
|
||||
// make thin lines even thinner to compensate for zoom factor
|
||||
if (bs.getLineWidth() <= 2)
|
||||
s = ObjectCache.getInstance().fetchBasicStroke((float) (bs.getLineWidth() / zoom));
|
||||
}
|
||||
canvasGraphics.setStroke(s);
|
||||
|
||||
Binary file not shown.
@@ -178,13 +178,13 @@ public class DIL_IC extends AbstractTransparentComponent<String> {
|
||||
Point firstPoint = controlPoints[0];
|
||||
controlPoints = new Point[pinCount.getValue()];
|
||||
controlPoints[0] = firstPoint;
|
||||
int pinSpacing = (int) this.pinSpacing.convertToPixels();
|
||||
int rowSpacing = (int) this.rowSpacing.convertToPixels();
|
||||
double pinSpacing = this.pinSpacing.convertToPixels();
|
||||
double rowSpacing = this.rowSpacing.convertToPixels();
|
||||
// Update control points.
|
||||
int dx1;
|
||||
int dy1;
|
||||
int dx2;
|
||||
int dy2;
|
||||
double dx1;
|
||||
double dy1;
|
||||
double dx2;
|
||||
double dy2;
|
||||
for (int i = 0; i < pinCount.getValue() / 2; i++) {
|
||||
switch (orientation) {
|
||||
case DEFAULT:
|
||||
@@ -214,21 +214,21 @@ public class DIL_IC extends AbstractTransparentComponent<String> {
|
||||
default:
|
||||
throw new RuntimeException("Unexpected orientation: " + orientation);
|
||||
}
|
||||
controlPoints[i] = new Point(firstPoint.x + dx1, firstPoint.y + dy1);
|
||||
controlPoints[i + pinCount.getValue() / 2] = new Point(firstPoint.x + dx2, firstPoint.y + dy2);
|
||||
controlPoints[i] = new Point((int) (firstPoint.x + dx1), (int) (firstPoint.y + dy1));
|
||||
controlPoints[i + pinCount.getValue() / 2] = new Point((int) (firstPoint.x + dx2), (int) (firstPoint.y + dy2));
|
||||
}
|
||||
}
|
||||
|
||||
public Area[] getBody() {
|
||||
if (body == null) {
|
||||
body = new Area[2];
|
||||
int x = controlPoints[0].x;
|
||||
int y = controlPoints[0].y;
|
||||
int width;
|
||||
int height;
|
||||
int pinSize = (int) PIN_SIZE.convertToPixels();
|
||||
int pinSpacing = (int) this.pinSpacing.convertToPixels();
|
||||
int rowSpacing = (int) this.rowSpacing.convertToPixels();
|
||||
double x = controlPoints[0].x;
|
||||
double y = controlPoints[0].y;
|
||||
double width;
|
||||
double height;
|
||||
double pinSize = PIN_SIZE.convertToPixels();
|
||||
double pinSpacing = this.pinSpacing.convertToPixels();
|
||||
double rowSpacing = this.rowSpacing.convertToPixels();
|
||||
Area indentation = null;
|
||||
int indentationSize = getClosestOdd(INDENT_SIZE.convertToPixels());
|
||||
switch (orientation) {
|
||||
|
||||
@@ -164,10 +164,10 @@ public class SIL_IC extends AbstractTransparentComponent<String> {
|
||||
Point firstPoint = controlPoints[0];
|
||||
controlPoints = new Point[pinCount.getValue()];
|
||||
controlPoints[0] = firstPoint;
|
||||
int pinSpacing = (int) this.pinSpacing.convertToPixels();
|
||||
double pinSpacing = this.pinSpacing.convertToPixels();
|
||||
// Update control points.
|
||||
int dx1;
|
||||
int dy1;
|
||||
double dx1;
|
||||
double dy1;
|
||||
for (int i = 0; i < pinCount.getValue(); i++) {
|
||||
switch (orientation) {
|
||||
case DEFAULT:
|
||||
@@ -189,7 +189,7 @@ public class SIL_IC extends AbstractTransparentComponent<String> {
|
||||
default:
|
||||
throw new RuntimeException("Unexpected orientation: " + orientation);
|
||||
}
|
||||
controlPoints[i] = new Point(firstPoint.x + dx1, firstPoint.y + dy1);
|
||||
controlPoints[i] = new Point((int) (firstPoint.x + dx1), (int) (firstPoint.y + dy1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,9 +199,9 @@ public class SIL_IC extends AbstractTransparentComponent<String> {
|
||||
int x = controlPoints[0].x;
|
||||
int y = controlPoints[0].y;
|
||||
int thickness = getClosestOdd(THICKNESS.convertToPixels());
|
||||
int width;
|
||||
int height;
|
||||
int pinSpacing = (int) this.pinSpacing.convertToPixels();
|
||||
double width;
|
||||
double height;
|
||||
double pinSpacing = (int) this.pinSpacing.convertToPixels();
|
||||
Area indentation = null;
|
||||
int indentationSize = getClosestOdd(INDENT_SIZE.convertToPixels());
|
||||
switch (orientation) {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1704,7 +1704,11 @@
|
||||
<changes>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<description>Red ticks on both rulers track 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>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
<description>Issues with DIL and SIL IC pin alignment when using metric grid and pin spacing</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
</changes>
|
||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||
|
||||
Reference in New Issue
Block a user