Inkscape.org
Beyond the Basics Layer shift on ungroup
  1. #1
    SorenTheSwede SorenTheSwede @SorenTheSwede
    *

    Hi all,

    I have an image I created some months ago, which consist of several grouped layers. Today, while using Inkscape 1.3.2 (091e20e, 2023-11-25, custom) running in Windows 10 PRO 22H2, I ran into an odd issue:

    1. I wanted to change the color on a single layer.
    2. As normal, I started to ungroup everything to select the single layer I want to change.
    3. However, when I ungroup everything, some of the layers shift ever so slightly upwards, screwing up the alignment of the various layers.
      1. It also looks as though one (or more?) layer is being slightly resized when I ungroup them.

    I've enclosed two SVGs; one of the original file and one with the layers ungrouped. I would urge you to compare the alignment of the layers in the eye and teeth, where the misalignment is most noticeable.

    I have never experienced this before. Has anyone else run into this? And how do I prevent this from happening?

    [Edited to remove artwork as it is no longer relevant for the subject]

  2. #2
    Paddy_CAD Paddy_CAD @Paddy_CAD

    When you ungroup, Inkscape recalculates node and shape coordinates to place them in the parent layer or group. Rounding errors are inevitable, but can be reduced. [shift+ctrl+p] [Input/Output > SVG Output] then increase the value of [Numeric precision: XX]. This increases the number of digits stored for every node so your file size will grow.

    Alternatively, don't ungroup the shape. [double-click] or [ctrl+enter] to open the group and work inside it where coordinate calculations are based on the group's internal origin (0,0).

  3. #3
    SorenTheSwede SorenTheSwede @SorenTheSwede

    Thank you for that prompt answer! I also realized that I can CTRL-click to choose a single object within a group. But I did not know that Inkscape recalculated the nodes on group/ungroup. Good to know!

  4. #4
    Aero Aero @Aero◻️

    I think it's a bug. Reproduced in Inkscape 1.4-rc1 (504fa7e, 2024-09-25)
    Workaround 1. Extensions - Arrange - Deep Ungroup.
    Workaround 2. Ungroup 3 groups (with transforms) in this order Lager 1, g20, g4212.