Fix pinch gesture in Wacom tablets

This is just a workaround, we should start using some of the new Wacom
or Windows 8 touch APIs.
This commit is contained in:
David Capello 2016-12-28 17:01:01 -03:00
parent 19b52a68b9
commit 8a5c3e49a3

View File

@ -541,7 +541,15 @@ namespace she {
ev.setModifiers(get_modifiers_from_last_win32_message());
ev.setPosition(gfx::Point(pos.x, pos.y) / m_scale);
int z = ((short)HIWORD(wparam)) / WHEEL_DELTA;
int z = GET_WHEEL_DELTA_WPARAM(wparam);
if (ABS(z) >= WHEEL_DELTA)
z /= WHEEL_DELTA;
else {
// TODO use floating point numbers or something similar
// (so we could use: z /= double(WHEEL_DELTA))
z = SGN(z);
}
gfx::Point delta(
(msg == WM_MOUSEHWHEEL ? z: 0),
(msg == WM_MOUSEWHEEL ? -z: 0));