Blame SOURCES/0359-vcl-lok-handle-tracking-coordinates-which-are-in-twi.patch

f325b2
From 077f463e0fdb16d1bd37154d0cfcb84959c63a66 Mon Sep 17 00:00:00 2001
f325b2
From: Miklos Vajna <vmiklos@collabora.co.uk>
f325b2
Date: Tue, 24 Nov 2015 15:01:01 +0100
f325b2
Subject: [PATCH 359/398] vcl lok: handle tracking coordinates which are in
f325b2
 twips
f325b2
f325b2
This is similar to the mouse button down handling. When the map mode is
f325b2
disabled and the map mode is in twips, then in general it's possible to
f325b2
send mouse coordinates in twips. The scrollbar is usually in pixels, so
f325b2
add extra code to still make this possible.
f325b2
f325b2
Change-Id: I0c7e404ecd7ac839e000266e396683bb7d15c505
f325b2
(cherry picked from commit d7acb44b148893fe0cc48a54c3eb73406c251668)
f325b2
---
f325b2
 vcl/source/control/scrbar.cxx | 14 +++++++++++++-
f325b2
 1 file changed, 13 insertions(+), 1 deletion(-)
f325b2
f325b2
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
f325b2
index e8004d13d177..0679c848b682 100644
f325b2
--- a/vcl/source/control/scrbar.cxx
f325b2
+++ b/vcl/source/control/scrbar.cxx
f325b2
@@ -1076,7 +1076,19 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt )
f325b2
     }
f325b2
     else
f325b2
     {
f325b2
-        const Point rMousePos = rTEvt.GetMouseEvent().GetPosPixel();
f325b2
+        Point aPosPixel;
f325b2
+        if (!IsMapModeEnabled() && GetMapMode().GetMapUnit() == MAP_TWIP)
f325b2
+        {
f325b2
+            // rTEvt coordinates are in twips.
f325b2
+            Push(PushFlags::MAPMODE);
f325b2
+            EnableMapMode();
f325b2
+            MapMode aMapMode = GetMapMode();
f325b2
+            aMapMode.SetOrigin(Point(0, 0));
f325b2
+            SetMapMode(aMapMode);
f325b2
+            aPosPixel = LogicToPixel(rTEvt.GetMouseEvent().GetPosPixel());
f325b2
+            Pop();
f325b2
+        }
f325b2
+        const Point rMousePos = (GetMapMode().GetMapUnit() != MAP_TWIP ? rTEvt.GetMouseEvent().GetPosPixel() : aPosPixel);
f325b2
 
f325b2
         // Dragging is treated in a special way
f325b2
         if ( meScrollType == SCROLL_DRAG )
f325b2
-- 
f325b2
2.12.0
f325b2