From bff9e0584317bd5a7352e67fd430849935edbf5d Mon Sep 17 00:00:00 2001 From: Bane Stojkovic Date: Sat, 7 Nov 2026 20:14:42 +0100 Subject: [PATCH] Rotated labels in pasted components and building blocks were drawn in the wrong place --- .../java/org/diylc/presenter/DrawingManager.java | 11 ++++++----- diylc/diylc-core/src/main/resources/update.xml | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/diylc/diylc-core/src/main/java/org/diylc/presenter/DrawingManager.java b/diylc/diylc-core/src/main/java/org/diylc/presenter/DrawingManager.java index 9347f04d4..0a2e1890a 100644 --- a/diylc/diylc-core/src/main/java/org/diylc/presenter/DrawingManager.java +++ b/diylc/diylc-core/src/main/java/org/diylc/presenter/DrawingManager.java @@ -424,20 +424,21 @@ public class DrawingManager { // Draw component slot in a separate composite. if (componentSlot != null) { - g2dWrapper.startedDrawingComponent(project.getComponents().size()); - g2dWrapper.setComposite(slotComposite); for (IDIYComponent component : componentSlot) { + // each component gets its own start/finish pair so that a transform, stroke or font it + // leaves behind (e.g. a rotated Label) is reverted before the next one is drawn + g2dWrapper.startedDrawingComponent(project.getComponents().size()); + g2dWrapper.setComposite(slotComposite); try { - component.draw(g2dWrapper, ComponentState.NORMAL, drawOptions.contains(DrawOption.OUTLINE_MODE), project, g2dWrapper); - } catch (Exception e) { LOG.error("Error drawing " + component.getName(), e); failedComponents.add(component); + } finally { + g2dWrapper.finishedDrawingComponent(); } } - g2dWrapper.finishedDrawingComponent(); } // Draw control points of the component in the slot. diff --git a/diylc/diylc-core/src/main/resources/update.xml b/diylc/diylc-core/src/main/resources/update.xml index 0226b62c4..37e1ef7b2 100644 --- a/diylc/diylc-core/src/main/resources/update.xml +++ b/diylc/diylc-core/src/main/resources/update.xml @@ -620,5 +620,21 @@ https://github.com/bancika/diy-layout-creator/releases + + + 6 + 11 + 0 + + 2026-11-07 00:00:00.000 CET + + + + BUG_FIX + Rotated labels in pasted components and building blocks were drawn in the wrong place and at the wrong angle while following the mouse, until the components were placed + + + https://github.com/bancika/diy-layout-creator/releases +