Hello, thanks again but unfortunately it looks like I need more help please
I just need to make simply line dragable, but want one end (let’s say start) to be constant. Something like lever, when I drag it close to that constant point (hinge) small movement turn the lever a lot. But when drag the end I can turn lever more precisely.
I created my own class inherited public from component. And in that class I created variable Line<float>. And in mouseDrag method I use something like that:
but it jumps like crazy. I tried also e.getEventRelativeTo( this ).position but also jump as crazy. It looks like it randomly change the relative position.
I also noticed, that hitTest doesn’t work as expect. I made it:
And start of line I hard coded. Then I take angle between my drag point to that hard coded start point by float angle = e.position.getAngleToPoint(startLine). And then I use: myLine = Line<float>::fromStartAndAngle(startLine, 100.0f, angle);
And everything would be great. But still my line jumps. Not as crazy as on attached gif, but still sometimes jumps strange.
I use setInterceptsMouseClicks(false, true); for all parent components, and other components that can be found under my drag coordinates. But it does not help.