Incorrect mouse position

Hi All

I am new at using juce and my first problem is incorrect mouse position.

I have a table which includes horizontal scroll bar. Everthing is ok when the scroll bar is left position but when I move it to right, mouse shows incorrect position. It shows incorrect position as much as I move it to right. I examine my codes and realized that the problem is with the function “relativePositionToOtherComponent”. Can sb help me?

I think you’ll need to give a better explanation of what you’re doing before anyone can help…

I am trying to select an area from the table by mouse. When I scroll the bar to the right, a space occurs between mouse icon and selected area. There is a problem with “x” value of juce::MouseEvent& e

As far as I know, X should includes the offset from the scrollbar.
Isn’t what you are seeing ?

[quote=“otristan”]As far as I know, X should includes the offset from the scrollbar.
Isn’t what you are seeing ?[/quote]

you mean there must be a constant offset from scrollbar?

I dont think so because the space is not constant… (the space between the scrollbar and the selected area)

nop I mean that if you move the scrollbar to the right of 100 pixel, then the mouse includes those 100 pixel.
The x position is absolute and do not substract the scrollbar position.

So if you need a relative position from the left border, you need to tweak it.

At least, this is the behavior I would expect.

[quote=“otristan”]nop I mean that if you move the scrollbar to the right of 100 pixel, then the mouse includes those 100 pixel.
The x position is absolute and do not substract the scrollbar position.

So if you need a relative position from the left border, you need to tweak it.

At least, this is the behavior I would expect.[/quote]

thank you very much, I will try it.