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:
bool hitTest(int x, int y)
Point<float> pointToTest(x, y);
return pointToTest.getDistanceFrom(myLine.getEnd()) < 100;
But I see
100 is measured not on the line from the end of it, but on the whole area around the line end.
Please could you give me more hints?
Now it works like that (on the gif file my mouse coursor disappeared, but I am drugging by the end of line):