Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Groups do not change size when child elements are moved or scaled down #4900

Open
2 tasks done
ErikSwan opened this issue Feb 11, 2025 · 0 comments
Open
2 tasks done

Comments

@ErikSwan
Copy link

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

You must agree to search and the code of conduct. You must fill in this entire template. If you delete part/all or miss parts out your issue will be closed.

If you are technical, you should report bugs along the lines of https://marker.io/blog/how-to-write-bug-report. If you are not technical, we will make allowances, please try to make an effort to understand the process.

Describe the bug
Group objects do not resize their bounding box to fit child elements in the case where a child element is moved or scaled down - they only appear to resize in the case where a child element is scaled up.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new blank diagram
  2. Add a basic rectangle and a circle to the diagram, and arrange them like the following:
    Image
  3. Select both shapes and group them with Ctrl+G:
    Image
  4. Select the circle, and scale it up by dragging the bottom-right handle. Note that the containing group bounding box resizes to fit the scaled-up child element. This is the expected behavior. ✅
    Image
  5. Hit Ctrl+Z to undo, then instead of scaling the circle up, click and drag to move it down and to the right. Note that the containing group bounding box does NOT expand to fit the new position of the circle. This is unexpected. ❌
    Image
  6. Hit Ctrl+Z to undo, then instead of moving the circle or scaling it up, drag the bottom-right handle and scale the circle down (make it smaller). Note that the containing group bounding box does not shrink/collapse to fit the new shape and size of the circle. This is unexpected. ❌
    Image

Expected behavior
I would expect that when the containing group object has the "Expand" property set (expand=1), which is set by default, the bounding box of the group object would adjust to fit the size and position of the child elements even when the child elements are scaled down or moved position, instead of only the case when a child element is increased in scale.

The fact that the group object bounding box does not resize in some cases even with the "Expand" property set is counter-intuitive when compared with how grouping works in most drawing/diagramming software (e.g. PowerPoint), and it makes working with groups annoying because moving or scaling down a child element requires either manually adjusting the group bounding box, or un-grouping and re-grouping to force the group bounding box to fit to the new size and position of the child elements.

Screenshots
See screenshots above in steps to reproduce.

draw.io version (In the Help->About menu of the draw.io editor):

  • draw.io version 26.0.11

Desktop (please complete the following information):

  • OS: Windows 10 Enterprise 22H2
  • Browser: Google Chrome 133.0.6943.60 (Official Build) (64-bit)

I tested the problem in incognito/private mode with all browser extensions switched off, write "yes" below:

  • Yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant