[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - avmedia/source
Zolnai Tamás
tamas.zolnai at collabora.com
Mon Jul 21 01:20:27 PDT 2014
avmedia/source/opengl/oglwindow.cxx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 4641e8f3e2675386df4418506861945e35cd69a0
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date: Wed Jul 16 14:55:43 2014 +0200
fdo#81182: Resizing glTF window affects camera position
Camera moves by click and drag, with checking the last mouse
position we can make sure click was done inside the window
before drag.
Resizing can trigger drag event, but not click event.
(cherry picked from commit 51ba2df1cb29d4343f92174da6dc8f36ba9152eb)
Conflicts:
avmedia/source/opengl/oglwindow.cxx
Change-Id: I9e8b70fcb4a0abf26e76e03cafd026f940eceb10
Reviewed-on: https://gerrit.libreoffice.org/10353
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/avmedia/source/opengl/oglwindow.cxx b/avmedia/source/opengl/oglwindow.cxx
index 2650faf..09a6333 100644
--- a/avmedia/source/opengl/oglwindow.cxx
+++ b/avmedia/source/opengl/oglwindow.cxx
@@ -20,7 +20,7 @@ OGLWindow::OGLWindow( glTFHandle& rHandle, OpenGLContext& rContext, Window& rEve
, m_rEventHandler( rEventHandlerParent )
, m_bVisible ( false )
, meZoomLevel( media::ZoomLevel_ORIGINAL )
- , m_aLastMousePos(Point())
+ , m_aLastMousePos(Point(0,0))
, m_bIsOrbitMode( false )
, m_fCameraDistance(0.0)
{
@@ -356,7 +356,7 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
m_rEventHandler.GrabFocus();
}
MouseEvent* pMouseEvt = (MouseEvent*)pEvent->GetData();
- if(pMouseEvt && pMouseEvt->IsLeft())
+ if(pMouseEvt && pMouseEvt->IsLeft() && m_aLastMousePos != Point(0,0))
{
const Point& aCurPos = pMouseEvt->GetPosPixel();
float fSensitivity = std::min(m_rHandle.viewport.width, m_rHandle.viewport.height);
@@ -388,6 +388,7 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
MouseEvent* pMouseEvt = (MouseEvent*)pEvent->GetData();
if(pMouseEvt && pMouseEvt->IsLeft() && pMouseEvt->GetClicks() == 1)
{
+ m_aLastMousePos = Point(0,0);
gltf_renderer_stop_rotate_model(&m_rHandle);
}
}
More information about the Libreoffice-commits
mailing list