matt
May 14, 2007, 11:16pm
1
I’m having problems with jumps in the vertical mouse position while dragging.
I did lots of debug prints and came up with this new bit of code in juce_mac_Windowing.cpp:
HIPoint p;
p.x = where.h;
p.y = where.v;
HIPointConvert (&p, kHICoordSpaceScreenPixel, 0,
kHICoordSpaceWindow, juce_currentMouseTrackingPeer->getNativeHandle());
const int x = p.x;
const int y = p.y;
The values being fed into HIPointConvert are OK; they behave as expected. The y values coming out of HIPointConvert sometimes jump by 20 or 30 pixels.
So I’m a little stumped.
jules
May 15, 2007, 8:04am
2
Hmm. I’ve always suspected that HIPointConvert is buggy, but have never proved anything…
Is it happening when the window is being moved? Is there an easy way I could see the problem here?
matt
May 15, 2007, 5:00pm
3
No, the window isn’t being moved - I’m simply dragging the mouse over a component.
I’ll see if I can reproduce it using the demo app.
matt
May 15, 2007, 10:21pm
4
Turns out it’s easy to reproduce with the JUCE demo - just turn on the native title bar on the Mac. Move one of the vertical sliders up and down - you’ll see it jump back and forth.
jules
May 16, 2007, 9:28am
5
Agh… you’re right. Ok, this is what it should have been:
HIPointConvert (&p, kHICoordSpaceScreenPixel, 0,
kHICoordSpaceView, ((HIViewComponentPeer*) juce_currentMouseTrackingPeer)->viewRef);
matt
May 16, 2007, 5:05pm
6
Looks like that took care of it - thanks, Jules.