You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue description:
A circle layer can be selected by clicking on its right at any distance. It makes circles of low Z depth so annoying you have to deactivate them.
Note that doing so still allow to incorrectly select a circle in the 2 right areas between the actual curve and its AABB due to intersect_conic matching twice in the special degenerate accept case in layer_shape.cpp:241
//degenerate accept - to the right and crossing the base line
if(x > xmax)
{
return (y <= ymax && y >= ymin);
}
The fact that the degenerate accept case of intersect_conic matches for x > xmax makes sense that the calling intersect function did NOT checked x vs aabb.maxx but I don't understand the usefulness of the degenerate accept case for now (probably too broad as it is written now)
You're welcome. I hoped I could do better but digging into a 12 years old function filled by conic maths without a good knowledge of the rest of synfig was a bit daunting.
I found that this bug was introduced in c6f7457 and 2fbdbcf when Circle Layer was rewritten to use Layer Shape. For some reason Layer Shape doesn't parse hit_check() function for this case correctly.
I have added explicit hit_check() function as a workaround. Closed via 38c383b.
Activity
zeograd commentedon Oct 15, 2017
It seems like CurveArray::intersect(Real, Real, Point*) (in layer_shape.cpp:525)
starts with
while it should rather be
Note that doing so still allow to incorrectly select a circle in the 2 right areas between the actual curve and its AABB due to intersect_conic matching twice in the special degenerate accept case in layer_shape.cpp:241
The fact that the degenerate accept case of intersect_conic matches for x > xmax makes sense that the calling intersect function did NOT checked x vs aabb.maxx but I don't understand the usefulness of the degenerate accept case for now (probably too broad as it is written now)
Parital fix for synfig#442 - Circle layers have wrong selection area.…
morevnaproject commentedon Oct 20, 2017
Thank you @zeograd! This is already better than before! I have committed your fix.
zeograd commentedon Oct 20, 2017
You're welcome. I hoped I could do better but digging into a 12 years old function filled by conic maths without a good knowledge of the rest of synfig was a bit daunting.
Revert "Parital fix for synfig#442 - Circle layers have wrong selecti…
Add hit_check() function for Circle Layer. Fixes synfig#442.
morevnaproject commentedon Oct 26, 2017
I found that this bug was introduced in c6f7457 and 2fbdbcf when Circle Layer was rewritten to use Layer Shape. For some reason Layer Shape doesn't parse hit_check() function for this case correctly.
I have added explicit hit_check() function as a workaround. Closed via 38c383b.
morevnaproject commentedon Dec 25, 2017
Now shipped with Synfig 1.3.5 - https://morevnaproject.org/2017/12/25/synfig-studio-1-3-5/
Intersector: fix for quadratic Bezier curves
Circle: remove custom hit-check method: not needed anymore
Intersector: fix for quadratic Bezier curves
Circle: remove custom hit-check method: not needed anymore
Intersector: fix for quadratic Bezier curves
Circle: remove custom hit-check method: not needed anymore