mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Fixed the issue with 'Add Flexible Leads' functionality placing the flexible leads wrong on leaded components (e.g. resistors, capacitors...)
This commit is contained in:
@@ -3763,13 +3763,17 @@
|
||||
<minor>22</minor>
|
||||
<build>1</build>
|
||||
</versionNumber>
|
||||
<releaseDate>2022-03-03 00:00:00.000 CET</releaseDate>
|
||||
<releaseDate>2022-03-07 00:00:00.000 CET</releaseDate>
|
||||
<name></name>
|
||||
<changes>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
<description>Fixed backwards compatibility issue with older files failing to open because of an issue with 'Tape Measure' component serialization</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
<description>Fixed the issue with 'Add Flexible Leads' functionality placing the flexible leads wrong on leaded components (e.g. resistors, capacitors...)</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
<description>Fixed display issue with Trace layer showing up as Wiring in the menu</description>
|
||||
|
||||
Binary file not shown.
@@ -55,8 +55,8 @@ public class FlexibleLeadsEditor implements IProjectEditor {
|
||||
if (l == null)
|
||||
return;
|
||||
|
||||
Point2D p1 = leaded.getControlPoint(0);
|
||||
Point2D p2 = leaded.getControlPoint(1);
|
||||
Point2D p1 = (Point2D) leaded.getControlPoint(0).clone();
|
||||
Point2D p2 = (Point2D) leaded.getControlPoint(1).clone();
|
||||
double d = p1.distance(p2);
|
||||
double len = l.convertToPixels() + 2;
|
||||
|
||||
@@ -86,8 +86,8 @@ public class FlexibleLeadsEditor implements IProjectEditor {
|
||||
// w1.setPointCount(PointCount.THREE);
|
||||
w1.setControlPoint(p1, 0);
|
||||
for (int i = 1; i < w1.getControlPointCount() - 1; i++) {
|
||||
double r = (len + diff) / (w1.getControlPointCount() - 1) * (w1.getControlPointCount() - i - 1);
|
||||
w1.setControlPoint(new Point2D.Double((int)Math.round(centerX - Math.cos(theta) * r), (int)Math.round(centerY - Math.sin(theta) * r)), i);
|
||||
double r = diff * i / (w1.getControlPointCount() - 1);
|
||||
w1.setControlPoint(new Point2D.Double((int)Math.round(p1.getX() + Math.cos(theta) * r), (int)Math.round(p1.getY() + Math.sin(theta) * r)), i);
|
||||
}
|
||||
w1.setControlPoint(newP1, w1.getControlPointCount() - 1);
|
||||
newSelection.add(w1);
|
||||
@@ -99,8 +99,8 @@ public class FlexibleLeadsEditor implements IProjectEditor {
|
||||
// w2.setPointCount(PointCount.THREE);
|
||||
w2.setControlPoint(p2, 0);
|
||||
for (int i = 1; i < w2.getControlPointCount() - 1; i++) {
|
||||
double r = (len + diff) / (w2.getControlPointCount() - 1) * (w2.getControlPointCount() - i - 1);
|
||||
w2.setControlPoint(new Point2D.Double((int)Math.round(centerX + Math.cos(theta) * r), (int)Math.round(centerY + Math.sin(theta) * r)), i);
|
||||
double r = diff * i / (w2.getControlPointCount() - 1);
|
||||
w2.setControlPoint(new Point2D.Double((int)Math.round(p2.getX() - Math.cos(theta) * r), (int)Math.round(p2.getY() - Math.sin(theta) * r)), i);
|
||||
}
|
||||
w2.setControlPoint(newP2, w2.getControlPointCount() - 1);
|
||||
newSelection.add(w2);
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.diylc.RegressionTestRunner"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="diylc-swing"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value=""C:\Users\bancika\Documents\GitHub\diy-layout-creator\diylc-regression-data" PREPARE user-files"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value=""C:\Users\bancika\Documents\GitHub\diy-layout-creator\diylc-regression-data" TEST user-files"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="diylc-swing"/>
|
||||
</launchConfiguration>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<property name="jar.dir" value="${build.dir}/jar" />
|
||||
<property name="report.dir" value="${build.dir}/junitreport" />
|
||||
<property name="main.class" value="org.diylc.DIYLCStarter" />
|
||||
<property name="diylc.version" value="4.22.0" />
|
||||
<property name="diylc.version" value="4.22.1" />
|
||||
|
||||
<property name="osx.jre8.path" value="jre\osx\jre8u321\Contents\Home\" />
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ A-O-I REGULATOR
|
||||
AWG
|
||||
And
|
||||
C-B-E BJT
|
||||
C1
|
||||
C2
|
||||
Check Trace Proximity
|
||||
D-G-S JFET
|
||||
D-G-S MOSFET
|
||||
|
||||
@@ -37,6 +37,16 @@
|
||||
<update_contact>nbenitezl_AT_gmail.com</update_contact>
|
||||
<content_rating type="oars-1.1"/>
|
||||
<releases>
|
||||
<release version="4.22.1" date="2022-03-07">
|
||||
<description>
|
||||
<ul>
|
||||
<li>[Bug Fix] Fixed backwards compatibility issue with older files failing to open because of an issue with 'Tape Measure' component serialization</li>
|
||||
<li>[Bug Fix] Fixed the issue with 'Add Flexible Leads' functionality placing the flexible leads wrong on leaded components (e.g. resistors, capacitors...)</li>
|
||||
<li>[Bug Fix] Fixed display issue with Trace layer showing up as Wiring in the menu</li>
|
||||
</ul>
|
||||
</description>
|
||||
<url>https://github.com/bancika/diy-layout-creator/releases/tag/v4.22.1</url>
|
||||
</release>
|
||||
<release version="4.22.0" date="2022-03-03">
|
||||
<description>
|
||||
<ul>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -471,8 +471,6 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
||||
public void zoom(int direction) {
|
||||
Point mousePosBefore = canvasPanel.getMousePosition(true);
|
||||
Point locationBefore = canvasPanel.getLocation();
|
||||
int relativeX = (int) (mousePosBefore.getX() + locationBefore.getX());
|
||||
int relativeY = (int) (mousePosBefore.getY() + locationBefore.getY());
|
||||
|
||||
// change zoom level
|
||||
double oldZoom = plugInPort.getZoomLevel();
|
||||
@@ -504,6 +502,8 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
||||
|
||||
if (selectionBounds == null) {
|
||||
// center to cursor
|
||||
int relativeX = (int) (mousePosBefore.getX() + locationBefore.getX());
|
||||
int relativeY = (int) (mousePosBefore.getY() + locationBefore.getY());
|
||||
Point desiredPos = new Point((int) (1d * mousePosBefore.getX() / oldZoom * newZoom),
|
||||
(int) (1d * mousePosBefore.getY() / oldZoom * newZoom));
|
||||
int newHorizontalPos = (int) (desiredPos.getX() - relativeX);
|
||||
|
||||
Reference in New Issue
Block a user