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

Target in group #2997

Merged
merged 19 commits into from
May 31, 2016
Merged

Target in group #2997

merged 19 commits into from
May 31, 2016

Conversation

asturur
Copy link
Member

@asturur asturur commented May 22, 2016

updated version of #2729

closes #485
closes #2998
closes #3005

@asturur
Copy link
Member Author

asturur commented May 22, 2016

Needs:

  • TESTS
  • add mouseover mouseout for subtargets (maybe separate PR)
  • regression checks
  • check strange behaviour with ITEXT ( it gets editables in active group)

DONE:

  • passing also subtargets to events on canvas (maybe yes don't want to spam too much events)

@asturur
Copy link
Member Author

asturur commented May 23, 2016

mouseover mouseout for subtargets will be made in a separate PR.
This pr has mouse up, mouse down, mouse move.

There should be no problem implementing something like that, but becase now we use _hoveredTarget and we must change to a chain of hoverd targets, i need to take some time to choose best way.

target = this._objects[i];
if (this._checkTarget(pointer, objects[i])) {
target = objects[i];
if (target.type === 'group' && target.subTargetCheck) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to better support subclassing, this would make more sense as target instanceof fabric.Group

samuelhorwitz added a commit to samuelhorwitz/fabric.js that referenced this pull request May 24, 2016
@samuelhorwitz
Copy link

Does Fabric expect nested grouping? addWithUpdate inside of a nested group breaks. I'm looking into that now on my branch also but is that a regression or a known state of affairs with regards to groups?

@asturur
Copy link
Member Author

asturur commented May 24, 2016

Groups can be nested. If not we fix it.
are you able to reproduce the bug with a small fiddle?

@samuelhorwitz
Copy link

samuelhorwitz commented May 24, 2016

Yeah, here is a code pen.

http://codepen.io/anon/pen/bpXyQM

Sorry for cluttering this issue, it came up with my work off this PR but then I realized it was actually going back to Fabric before any of these changes.

EDIT Here is a pen with a solution I found http://codepen.io/anon/pen/yOmWww It removes the group from it's parent, then adds stuff to itself, then adds itself back to it's parent. Not the most beautiful solution, but points to the issue being with nested coordinate systems most likely

@asturur
Copy link
Member Author

asturur commented May 25, 2016

Nesting group will be topic of another PR. I need to keep changes small, independent, revertable, understandable.

Does the subtargeting work in group of groups?

@samuelhorwitz
Copy link

Yes, subtargeting works fine in groups of groups

@asturur asturur merged commit 0c6a665 into master May 31, 2016
@NikitaPirat
Copy link

Hi,
thanks a lot for your work! Could you say when will be the next release? I hope this fix will be there.

Thanks

samuelhorwitz added a commit to samuelhorwitz/fabric.js that referenced this pull request Jul 8, 2016
samuelhorwitz added a commit to samuelhorwitz/fabric.js that referenced this pull request Jul 8, 2016
@asturur asturur deleted the targetInGroup branch July 17, 2016 06:38
samuelhorwitz added a commit to samuelhorwitz/fabric.js that referenced this pull request Sep 21, 2016
@helia19s
Copy link

helia19s commented Dec 5, 2016

The subTargetCheck feature only works for Groups not pathgroup. I tried to fix it my self but the problem is the path position in a group is incorrect when we have scale and angle. I'm working with svg image and I need help . will it get fixed in next releases ?

@asturur
Copy link
Member Author

asturur commented Dec 5, 2016

no. pathgroups are completely different, are not meant for group/ungrouping, they are harder to handle due to transform matrix.
There is a PR open, blocked from some rounding issue in positioning that aims at removing path-groups to have just groups.
I'm not expanding any path-group feature since the idea is to remove them.

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

Successfully merging this pull request may close these issues.

Polygon perPixelTargetFind Multiselection with editing itext Support events for objects in group [$35]
4 participants