Nux

Merge lp:~nux-team/nux/lp-1228093 into lp:nux/trusty

Proposed by Stephen M. Webb on 2014-09-30
Status: Merged
Approved by: Marco Trevisan (TreviƱo) on 2014-09-30
Approved revision: 846
Merged at revision: 846
Proposed branch: lp:~nux-team/nux/lp-1228093
Merge into: lp:nux/trusty
Diff against target: 65 lines (+27/-10)
2 files modified
Nux/ScrollView.cpp (+25/-8)
NuxGraphics/GraphicsDisplayX11.cpp (+2/-2)
To merge this branch: bzr merge lp:~nux-team/nux/lp-1228093
Reviewer Review Type Date Requested Status
Eleni Maria Stea (community) 2014-09-30 Approve on 2014-09-30
Review via email: mp+236506@code.launchpad.net

Commit message

ScrollView: correctly handle vertical and horizontal scrolling.

Description of the change

Correctly handle vertical and horizontal scrolling.

Fix cherry-picked from dev branch for SRU into Ubuntu 14.04.

To post a comment you must log in.
Eleni Maria Stea (hikiko) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Nux/ScrollView.cpp'
2--- Nux/ScrollView.cpp 2013-04-08 14:02:32 +0000
3+++ Nux/ScrollView.cpp 2014-09-30 12:54:09 +0000
4@@ -712,14 +712,31 @@
5 {
6 // nux can't tell the difference between horizontal and vertical mouse wheel events
7 // so we are only going to support vertical
8- if (wheel_delta < 0)
9- {
10- ScrollDown(abs(wheel_delta / NUX_MOUSEWHEEL_DELTA), m_MouseWheelScrollSize);
11- }
12- else
13- {
14- ScrollUp(abs(wheel_delta / NUX_MOUSEWHEEL_DELTA), m_MouseWheelScrollSize);
15- }
16+ if (abs(wheel_delta) == NUX_MOUSEWHEEL_DELTA)
17+ {
18+ // Vertical Scrolling
19+ if (wheel_delta < 0)
20+ {
21+ ScrollDown(1, m_MouseWheelScrollSize);
22+ }
23+ else
24+ {
25+ ScrollUp(1, m_MouseWheelScrollSize);
26+ }
27+ }
28+ else if (abs(wheel_delta) == (NUX_MOUSEWHEEL_DELTA ^ 2))
29+ {
30+ // Horizontal Scrolling
31+ if (wheel_delta < 0)
32+ {
33+ ScrollRight(1, m_MouseWheelScrollSize);
34+ }
35+ else
36+ {
37+ ScrollLeft(1, m_MouseWheelScrollSize);
38+ }
39+ }
40+
41 }
42
43 bool ScrollView::AcceptKeyNavFocus()
44
45=== modified file 'NuxGraphics/GraphicsDisplayX11.cpp'
46--- NuxGraphics/GraphicsDisplayX11.cpp 2013-12-18 21:43:30 +0000
47+++ NuxGraphics/GraphicsDisplayX11.cpp 2014-09-30 12:54:09 +0000
48@@ -1200,7 +1200,7 @@
49 {
50 _mouse_state |= NUX_EVENT_MOUSEWHEEL;
51 m_pEvent->type = NUX_MOUSE_WHEEL;
52- m_pEvent->wheel_delta = NUX_MOUSEWHEEL_DELTA;
53+ m_pEvent->wheel_delta = (NUX_MOUSEWHEEL_DELTA ^ 2);
54 return 1;
55 }
56
57@@ -1208,7 +1208,7 @@
58 {
59 _mouse_state |= NUX_EVENT_MOUSEWHEEL;
60 m_pEvent->type = NUX_MOUSE_WHEEL;
61- m_pEvent->wheel_delta = -NUX_MOUSEWHEEL_DELTA;
62+ m_pEvent->wheel_delta = -(NUX_MOUSEWHEEL_DELTA ^ 2);
63 return 1;
64 }
65 }

Subscribers

People subscribed via source and target branches

to all changes: