mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Board underside display does not work if there's a Label or PCB Text component on the board
This commit is contained in:
@@ -201,10 +201,10 @@ public class DrawingManager {
|
|||||||
if (c == board) {
|
if (c == board) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
boolean include = true;
|
boolean include = false;
|
||||||
for (int i = 0; i < c.getControlPointCount(); i++) {
|
for (int i = 0; i < c.getControlPointCount(); i++) {
|
||||||
if (!boardRect.contains(c.getControlPoint(i))) {
|
if (boardRect.contains(c.getControlPoint(i))) {
|
||||||
include = false;
|
include = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -333,6 +333,7 @@ public class DrawingManager {
|
|||||||
lastDrawnStateMap.put(component, state);
|
lastDrawnStateMap.put(component, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
// Mirror components that belong to boards that need to be mirrored
|
// Mirror components that belong to boards that need to be mirrored
|
||||||
if (componentBoardMap.containsKey(component)) {
|
if (componentBoardMap.containsKey(component)) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -341,7 +342,8 @@ public class DrawingManager {
|
|||||||
if (componentType.getTransformer() != null) {
|
if (componentType.getTransformer() != null) {
|
||||||
Set<IBoard> boards = componentBoardMap.get(component);
|
Set<IBoard> boards = componentBoardMap.get(component);
|
||||||
for (IBoard board : boards) {
|
for (IBoard board : boards) {
|
||||||
drawMirroredComponent(project, board, component, componentType, g2dWrapper, state, outlineMode);
|
drawMirroredComponent(project, board, component, componentType, g2dWrapper, state,
|
||||||
|
outlineMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -352,9 +354,15 @@ public class DrawingManager {
|
|||||||
ComponentType componentType = ComponentProcessor.getInstance()
|
ComponentType componentType = ComponentProcessor.getInstance()
|
||||||
.extractComponentTypeFrom((Class<? extends IDIYComponent<?>>) component.getClass());
|
.extractComponentTypeFrom((Class<? extends IDIYComponent<?>>) component.getClass());
|
||||||
if (componentType.getTransformer() != null) {
|
if (componentType.getTransformer() != null) {
|
||||||
drawMirroredComponent(project, (IBoard) component, component, componentType, g2dWrapper, state, outlineMode);
|
drawMirroredComponent(project, (IBoard) component, component, componentType,
|
||||||
|
g2dWrapper, state, outlineMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
// revert composite
|
||||||
|
g2d.setComposite(oldComposite);
|
||||||
|
g2d.setFont(oldFont);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -357,6 +357,10 @@
|
|||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
<description>Removed 'DP3T' options from 'Mini Toggle Switch' because that is covered by 'Slide Switch' component and does not belong here</description>
|
<description>Removed 'DP3T' options from 'Mini Toggle Switch' because that is covered by 'Slide Switch' component and does not belong here</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
<description>Include components in the underside display that have at least one control point laying in the board, as opposed to all</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>Applying a variant to a 'Hookup Wire' or 'Curved Trace' makes it lose its shape</description>
|
<description>Applying a variant to a 'Hookup Wire' or 'Curved Trace' makes it lose its shape</description>
|
||||||
@@ -365,6 +369,14 @@
|
|||||||
<changeType>BUG_FIX</changeType>
|
<changeType>BUG_FIX</changeType>
|
||||||
<description>Copy operation doesn't work when certain component types are selected</description>
|
<description>Copy operation doesn't work when certain component types are selected</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>BUG_FIX</changeType>
|
||||||
|
<description>Board underside display does not work if there's a Label or PCB Text component on the board</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>BUG_FIX</changeType>
|
||||||
|
<description>Using board underside display sometimes makes other components semi-transparent</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
</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>
|
||||||
|
|||||||
+1
-16
@@ -26,23 +26,13 @@ import org.diylc.components.misc.Label;
|
|||||||
import org.diylc.components.misc.PCBText;
|
import org.diylc.components.misc.PCBText;
|
||||||
import org.diylc.core.IDIYComponent;
|
import org.diylc.core.IDIYComponent;
|
||||||
|
|
||||||
public class TextTransformer implements IComponentTransformer {
|
public class TextTransformer extends SimpleComponentTransformer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canRotate(IDIYComponent<?> component) {
|
public boolean canRotate(IDIYComponent<?> component) {
|
||||||
return component.getClass().equals(Label.class) || component.getClass().equals(PCBText.class);
|
return component.getClass().equals(Label.class) || component.getClass().equals(PCBText.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canMirror(IDIYComponent<?> component) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean mirroringChangesCircuit() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void rotate(IDIYComponent<?> component, Point2D center, int direction) {
|
public void rotate(IDIYComponent<?> component, Point2D center, int direction) {
|
||||||
AffineTransform rotate = AffineTransform.getRotateInstance(Math.PI / 2 * direction, center.getX(), center.getY());
|
AffineTransform rotate = AffineTransform.getRotateInstance(Math.PI / 2 * direction, center.getX(), center.getY());
|
||||||
@@ -76,9 +66,4 @@ public class TextTransformer implements IComponentTransformer {
|
|||||||
snap.setOrientation(o);
|
snap.setOrientation(o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mirror(IDIYComponent<?> component, Point2D center, int direction) {
|
|
||||||
throw new RuntimeException("Unexpected call to mirror() in LabelTransformer");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user