[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - avmedia/source
Jan Holesovsky
kendy at collabora.com
Mon May 19 16:06:12 PDT 2014
avmedia/source/opengl/oglwindow.cxx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 18f07f27b14023977ad4488bc11092dc78a22a32
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue May 20 01:05:12 2014 +0200
gltf: Send delta when rotating, not absolute value.
Change-Id: I2453132fedc9a38f43c3de4b110459ba7771d085
diff --git a/avmedia/source/opengl/oglwindow.cxx b/avmedia/source/opengl/oglwindow.cxx
index a3e5623..7bdc9f7 100644
--- a/avmedia/source/opengl/oglwindow.cxx
+++ b/avmedia/source/opengl/oglwindow.cxx
@@ -300,13 +300,19 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
if(pMouseEvt && pMouseEvt->IsLeft())
{
const Point& aCurPos = pMouseEvt->GetPosPixel();
+ float fSensitivity = std::min(m_pHandle->viewport.width, m_pHandle->viewport.height);
+ if (fSensitivity == 0.0)
+ fSensitivity = 1.0;
+ else
+ fSensitivity = 540.0 / fSensitivity;
long nDeltaX = m_aLastMousePos.X()-aCurPos.X();
long nDeltaY = aCurPos.Y()-m_aLastMousePos.Y();
- static const float fSensitivity = 1.0;
// TODO: It seems this method just moves the camera but not rotate it.
gltf_renderer_rotate_camera((float)nDeltaX*fSensitivity,(float)nDeltaY*fSensitivity,0.0,0.0);
update();
+
+ m_aLastMousePos = aCurPos;
}
}
return 0;
More information about the Libreoffice-commits
mailing list