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

fabric group does't work with the subTargetCheck attribute #4444

Closed
jefferybai opened this issue Nov 9, 2017 · 10 comments · Fixed by #4454
Closed

fabric group does't work with the subTargetCheck attribute #4444

jefferybai opened this issue Nov 9, 2017 · 10 comments · Fixed by #4454

Comments

@jefferybai
Copy link

jefferybai commented Nov 9, 2017

Create a group and set subTargetCheck as true,
then convert it to json,and reload the Json,
fabric does not work.

let svgGroup = new fabric.Group(svgs, Object.assign({}, {
utype: 'svg',
left: canvas.width / 2, top: canvas.height / 2,
subTargetCheck: true,
id: Date.now() + String.fromCharCode(65 + Math.floor(Math.random() * 26))})
);

    canvas.toObject(['subTargetCheck', 'utype']);

then reload the json

  let draftingObj = canvas.getObjects().filter(item => item.utype == 'svg')[0];
                draftingObj.on('mousedown', (e) => {
           
                        })

fabric.require.js:3 Uncaught TypeError: Cannot read property 'tl' of null
at klass._getImageLines (fabric.require.js:3)
at klass.eval [as _getImageLines] (makeAssimilatePrototype.js:15)
at klass.containsPoint (fabric.require.js:3)
at klass.eval [as containsPoint] (makeAssimilatePrototype.js:15)
at klass.containsPoint (fabric.require.js:3)
at klass._checkTarget (fabric.require.js:3)
at klass._searchPossibleTargets (fabric.require.js:3)
at klass._searchPossibleTargets (fabric.require.js:3)
at klass.findTarget (fabric.require.js:3)
at klass.__onMouseMove (fabric.require.js:3)
_getImageLines @ fabric.require.js:3
(anonymous) @ makeAssimilatePrototype.js:15
containsPoint @ fabric.require.js:3
(anonymous) @ makeAssimilatePrototype.js:15
containsPoint @ fabric.require.js:3
_checkTarget @ fabric.require.js:3
_searchPossibleTargets @ fabric.require.js:3
_searchPossibleTargets @ fabric.require.js:3
findTarget @ fabric.require.js:3
__onMouseMove @ fabric.require.js:3
_onMouseMove @ fabric.require.js:3

@asturur
Copy link
Member

asturur commented Nov 9, 2017

interesting.
i think i know where the bug is. i ll flag as a bug and see if i can fix it.
Should be a problem of 1.7 too to backport.

@asturur
Copy link
Member

asturur commented Nov 9, 2017

What version are you using?

@jefferybai
Copy link
Author

I'm using version: "1.7.17", but the latest version have same problem

@takaobaltazar
Copy link

takaobaltazar commented Nov 10, 2017

Hi,

I am also encountering this issue, using the latest version of fabric : 1.7.19.

https://stackoverflow.com/questions/47207180/sub-target-property-of-fabric-js-group-is-not-being-exported

@durga598
Copy link
Contributor

Working in 1.7.3 , not after that.

@takaobaltazar
Copy link

Hi @durga598 ,

I tried the 1.7.3 version of fabric, and it works. Thanks for this info.

@ThakurKarthik
Copy link

@asturur I currently see this issue in 3.6.2 version.We are trying to migrate from 1.5.0 to this stable version 😃

TypeError: Cannot read property 'tl' of null
    at klass._getImageLines (fabric.js:15366)
    at klass.containsPoint (fabric.js:15289)
    at klass.containsPoint (fabric.js:9857)
    at klass._checkTarget (fabric.js:10593)
    at klass._searchPossibleTargets (fabric.js:10622)
    at klass.findTarget (fabric.js:10573)
    at klass.__onMouseMove (fabric.js:11913)
    at klass._onMouseMove (fabric.js:11492)

Iam just drawing a line.

@asturur
Copy link
Member

asturur commented Feb 26, 2020

can you replicate this in a minimal fiddle? it deserves a new issue.

@itsdeekay
Copy link

Hi I am facing same issue with latest fabric. Code can be checked at https://jsfiddle.net/L09qmbu8

@asturur
Copy link
Member

asturur commented May 30, 2020

@itsdeekay your fiddle is so much elaborate.
What is acutally the problem, can you focus around it instead of blurring and doing other things?

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

Successfully merging a pull request may close this issue.

6 participants