-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Group Position Doesn't Retain #2073
Comments
If, after adding the items, I then set left and top everything looks correct. |
There also seems to be a glitch that causes neither the group nor items in the group to be selectable. |
there is an old discussion about this. mainly the group wrap himself around object positions. Only after the group is created you can force is position. after setting the group top and left you have to call setCoords to make it selectable. |
this seems really clunky to me and painful to use....are there any plans to change this? |
we have mayor bugs and features to solve and implement. but we are always open to suggestions. yeah grop is a little bit unconfortable to work with. |
That's a shame. Most of the functionality of FabricJS I have been very impressed with. Group is the first major frustration point I've hit. |
I was thinking about this. I position a group at 50,50. i want to keep the group at 50,50, where should rect and circle be? |
@asturur sorry for the very late reply: The absolute position within the canvas of circle and rect should be 110x110 and 60x60 respectively. Perhaps I'm not fully understanding your question, but I don't see how adding anything to the group would change anything. |
so you mean translating the given top and left to add from the top left of the group. That can be done by code, but when you are grouping from graphic interface it looks very strange. |
i just posted a new bug report which may be similar in nature: #3837 the current behavior seems broken when using group.add(). however, things seem to work correctly if objects are added in the group constructor. (i haven't tested extensively) basically, when an object is added to a new container, its position should be relative to that container's originX/Y (oX/oY). say we have a Rect with oX/oY Top Left with pos 10, 20 in canvas. considering a Group with oX/oY Top Left at 30, 40 and h/w of 60, 60. the absolute position (in Canvas-space) of Rect when added to Group should be 40, 60. taking same Group (at current position), but changing oX/oY to Center/Center, the absolute position of added Rect should be 70, 90. i just started working with fabricjs on a new project. right now, in order to get the correct behavior, it's necessary to offset left/top coordinates by 1/2 of width/height. this should be unnecessary if the originX/Y system was working correctly. |
This is very old. But relevant. |
I am currently creating a group with an empty array (no children) to start with and I want it to be centered at 100x100. Unfortunately when I set those values and then addWithUpdate the left and top seem to be getting reset to 0x0.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: