summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-03-03 22:23:54 +0200
committerTor Lillqvist <tml@iki.fi>2013-03-03 22:29:54 +0200
commit6339bf132518130d4093869f9913df5b103bf5d3 (patch)
tree75ed66aafc51fecce3ce1e201ab252940b3601e0 /sc
parent5facce3c212387054d2da05672445556f5bca14d (diff)
Android "desktop" app: More hacking on scaling
Added a new "mode" for the CommandWheelData, COMMAND_WHEEL_ZOOM_SCALE, where the "delta" is the scale percentage to multiply the curent zoom factor with. Implement in Writer and Calc. But actually, I am more and more startng to think that live scaling of the document view during the pinch/spread gesture will never perform fast enough. Need to go back to the (simple) trick to just scale the BitmapView, and do the actual LO re-zoom only when the gesture finishes. But in order for that to look nicer, need to get rid of the LO UI element clutter around the document, scrollbars, buttons etc. Plus of course need to make sure the LO zooming happens around the gesture center position. Change-Id: I20dfcb4c2a97aacbf7e5b6ea5c24816b237fe687
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/tabview.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 0d3c92ce8613..52ef47bd0fb6 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -965,7 +965,8 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
bool bDone = false;
const CommandWheelData* pData = rCEvt.GetWheelData();
- if ( pData && pData->GetMode() == COMMAND_WHEEL_ZOOM )
+ if ( pData && (pData->GetMode() == COMMAND_WHEEL_ZOOM ||
+ pData->GetMode() == COMMAND_WHEEL_ZOOM_SCALE ) )
{
if ( !aViewData.GetViewShell()->GetViewFrame()->GetFrame().IsInPlace() )
{
@@ -975,11 +976,16 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
const Fraction& rOldY = aViewData.GetZoomY();
long nOld = (long)(( rOldY.GetNumerator() * 100 ) / rOldY.GetDenominator());
long nNew = nOld;
- if ( pData->GetDelta() < 0 )
- nNew = Max( (long) MINZOOM, basegfx::zoomtools::zoomOut( nOld ));
- else
- nNew = Min( (long) MAXZOOM, basegfx::zoomtools::zoomIn( nOld ));
-
+ if ( pData->GetMode() == COMMAND_WHEEL_ZOOM_SCALE )
+ {
+ nNew = 100 * (long) ((nOld / 100.0) * (pData->GetDelta() / 100.0));
+ } else
+ {
+ if ( pData->GetDelta() < 0 )
+ nNew = Max( (long) MINZOOM, basegfx::zoomtools::zoomOut( nOld ));
+ else
+ nNew = Min( (long) MAXZOOM, basegfx::zoomtools::zoomIn( nOld ));
+ }
if ( nNew != nOld )
{
// scroll wheel doesn't set the AppOptions default