Snap.svg icon indicating copy to clipboard operation
Snap.svg copied to clipboard

how to ungroup g ?

Open ucandoit1010 opened this issue 8 years ago • 6 comments

#Hi ! I found undrag , unclick method. but where is ungroup ?

here is my svg

<g transform="matrix(1,0,0,1,139,35)"><rect x="150" y="150" width="50" height="50" fill="#ffffff" stroke="#000000" style="stroke-width: 4; opacity: 0.5;" class="jtool got"></rect><circle cx="150" cy="150" r="25" fill="#ffffff" stroke="#000000" style="stroke-width: 4; opacity: 0.5;" class="jtool got"></circle></g>

thank you !

ucandoit1010 avatar Dec 03 '17 05:12 ucandoit1010

It's not really clear what you would want from this. Group is an svg element, not a handler. If you want to remove an element from a group, you can just add/append the element again somewhere else (not in the group).

ibrierley avatar Dec 03 '17 08:12 ibrierley

thank you sir ! I made an example for my question.

https://jsfiddle.net/taiwanhotdog/1nzo7pL4/

step 1. mouse drag select two shapes. step 2. drag group to any position. step 3. click ungroup button.

after ungorup the new position is wrong !

ucandoit1010 avatar Dec 04 '17 03:12 ucandoit1010

I just get an error 'selections is not defined'

ibrierley avatar Dec 04 '17 07:12 ibrierley

sorry , try again please https://jsfiddle.net/taiwanhotdog/1nzo7pL4/1/

ucandoit1010 avatar Dec 04 '17 08:12 ucandoit1010

Still doesn't do anything. I think this is probably better a question for Stackoverflow, I don't really see any bug here, unless it's just a feature request, but you should be able to just append the element, and then set any transformations you want on it (eg the transformation that the group had plus the element), that's more of a coding/logic issue.

ibrierley avatar Dec 04 '17 09:12 ibrierley

thank you sir ! I found this issue . I had same issue https://github.com/adobe-webplatform/Snap.svg/issues/277

ucandoit1010 avatar Dec 04 '17 09:12 ucandoit1010