'Schaller Megaswitch' not rendered correctly when rotated for 90 or 270 degrees

This commit is contained in:
Bane Stojkovic
2026-06-08 22:35:41 +02:00
parent 0526ce38f4
commit 3fbc7f5bc9
3 changed files with 8 additions and 4 deletions
@@ -405,6 +405,10 @@
<changeType>BUG_FIX</changeType>
<description>Dragging a component from the component tree to the canvas sometimes does not work as expected without clicking on it first and then dragging it</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType>
<description>'Schaller Megaswitch' not rendered correctly when rotated for 90 or 270 degrees</description>
</org.diylc.appframework.update.Change>
</changes>
<url>https://github.com/bancika/diy-layout-creator/releases</url>
</org.diylc.appframework.update.Version>
@@ -237,9 +237,9 @@ public class FreewayBlade extends AbstractAngledComponent<String> implements ISw
// Rotate if needed
if (theta != 0) {
// Skip the last two because terminals are already rotated
// Skip the last one because terminals are already rotated
AffineTransform rotation = AffineTransform.getRotateInstance(theta, x, y);
for (int i = 0; i < body.length - 2; i++) {
for (int i = 0; i < body.length - 1; i++) {
Shape shape = body[i];
Area area = (Area) shape;
area.transform(rotation);
@@ -277,9 +277,9 @@ public class SchallerMegaSwitch extends AbstractAngledComponent<String> implemen
// Rotate if needed
if (theta != 0) {
// Skip the last two because terminals are already rotated
// Skip the last one because terminals are already rotated
AffineTransform rotation = AffineTransform.getRotateInstance(theta, x, y);
for (int i = 0; i < body.length - 2; i++) {
for (int i = 0; i < body.length - 1; i++) {
Shape shape = body[i];
Area area = (Area) shape;
area.transform(rotation);