mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
Component leads on resistors, capacitors, etc disappear when they are
very short
This commit is contained in:
@@ -3033,5 +3033,21 @@
|
|||||||
</changes>
|
</changes>
|
||||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||||
</org.diylc.appframework.update.Version>
|
</org.diylc.appframework.update.Version>
|
||||||
|
<org.diylc.appframework.update.Version>
|
||||||
|
<versionNumber>
|
||||||
|
<major>4</major>
|
||||||
|
<minor>6</minor>
|
||||||
|
<build>0</build>
|
||||||
|
</versionNumber>
|
||||||
|
<releaseDate>2020-04-20 00:00:00.000 CET</releaseDate>
|
||||||
|
<name></name>
|
||||||
|
<changes>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>BUG_FIX</changeType>
|
||||||
|
<description>Component leads on resistors, capacitors, etc disappear when they are very short</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
|
</changes>
|
||||||
|
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||||
|
</org.diylc.appframework.update.Version>
|
||||||
</a>
|
</a>
|
||||||
</java.util.Arrays_-ArrayList>
|
</java.util.Arrays_-ArrayList>
|
||||||
|
|||||||
Binary file not shown.
@@ -88,6 +88,8 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
|||||||
protected transient Double gamma = null;
|
protected transient Double gamma = null;
|
||||||
protected transient Double r = null;
|
protected transient Double r = null;
|
||||||
|
|
||||||
|
private Boolean hideShortLeads = false;
|
||||||
|
|
||||||
protected AbstractLeadedComponent() {
|
protected AbstractLeadedComponent() {
|
||||||
super();
|
super();
|
||||||
try {
|
try {
|
||||||
@@ -205,7 +207,7 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
|||||||
double leadLength = (distance - calculatePinSpacing(shapeRect)) / 2;
|
double leadLength = (distance - calculatePinSpacing(shapeRect)) / 2;
|
||||||
|
|
||||||
// only draw leads longer than threshold
|
// only draw leads longer than threshold
|
||||||
if (leadLength > LEAD_RENDER_THRESHOLD) {
|
if (leadLength > LEAD_RENDER_THRESHOLD || !getHideShortLeads()) {
|
||||||
if (shouldShadeLeads()) {
|
if (shouldShadeLeads()) {
|
||||||
Stroke leadStroke = ObjectCache.getInstance().fetchBasicStroke(leadThickness - 1);
|
Stroke leadStroke = ObjectCache.getInstance().fetchBasicStroke(leadThickness - 1);
|
||||||
Color leadColor = getLeadColorForPainting(componentState);
|
Color leadColor = getLeadColorForPainting(componentState);
|
||||||
@@ -717,6 +719,17 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
|||||||
return new Rectangle2D.Double(minX - margin, minY - margin, maxX - minX + 2 * margin, maxY - minY + 2 * margin);
|
return new Rectangle2D.Double(minX - margin, minY - margin, maxX - minX + 2 * margin, maxY - minY + 2 * margin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for internal use. Set this flag to true when replacing standard leads with flexible ones
|
||||||
|
public Boolean getHideShortLeads() {
|
||||||
|
if (hideShortLeads == null)
|
||||||
|
hideShortLeads = false;
|
||||||
|
return hideShortLeads;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHideShortLeads(Boolean hideShortLeads) {
|
||||||
|
this.hideShortLeads = hideShortLeads;
|
||||||
|
}
|
||||||
|
|
||||||
public enum LabelOriantation {
|
public enum LabelOriantation {
|
||||||
Directional, Horizontal
|
Directional, Horizontal
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ public class FlexibleLeadsEditor implements IProjectEditor {
|
|||||||
leaded.setControlPoint(newP1, 0);
|
leaded.setControlPoint(newP1, 0);
|
||||||
leaded.setControlPoint(newP2, 1);
|
leaded.setControlPoint(newP2, 1);
|
||||||
|
|
||||||
|
// make the standard leads go away
|
||||||
|
leaded.setHideShortLeads(true);
|
||||||
|
|
||||||
// create leads
|
// create leads
|
||||||
HookupWire w1 = new HookupWire();
|
HookupWire w1 = new HookupWire();
|
||||||
getInstantiationManager().fillWithDefaultProperties(w1, null);
|
getInstantiationManager().fillWithDefaultProperties(w1, null);
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user