Well, finally I did it differnetly and it works.
I post here the “algorithmic” soultion in my case (it may help someone)
I wanted to get when I was intersecting with a line while I was dragging a rectangle, so what I did was:
Rectangle{
id: dragged
MouseArea{
drag.target: dragged
onPositionChanged:{
for each line I may intercept{
d = distance(line, mouseX,mouseY) //This gives me the line from (mouseX,mouseY) to the line
if(d < line.width){
//it means I'm on the line while dragging the rectangle.
}
}
}
}
}
well, thank you again for the quick answer ;)
↧