summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/inputzoom.c
diff options
context:
space:
mode:
authorxsacha <xsacha@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-14 14:48:18 +0000
committerxsacha <xsacha@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-14 14:48:18 +0000
commit8ed1ef61f82b7ef866d0c81e77383b8b499ed968 (patch)
tree410a0e4cc4abe884f8242df3c9c1d3b1b8cdc4da /beryl-plugins/src/inputzoom.c
parent918447e34b462a08cc7d1783e434e23620ade099 (diff)
downloadmarex-dev-8ed1ef61f82b7ef866d0c81e77383b8b499ed968.tar.gz
marex-dev-8ed1ef61f82b7ef866d0c81e77383b8b499ed968.tar.bz2
Prevent zoom from going below 1.0 -- fixes annoying bounce when user is trying to cancel zoom
git-svn-id: file:///beryl/trunk@4060 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/inputzoom.c')
-rw-r--r--beryl-plugins/src/inputzoom.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/beryl-plugins/src/inputzoom.c b/beryl-plugins/src/inputzoom.c
index 3c65d8d..471d1f9 100644
--- a/beryl-plugins/src/inputzoom.c
+++ b/beryl-plugins/src/inputzoom.c
@@ -513,6 +513,17 @@ zoomApplyScreenTransform(CompScreen * s,
ow = s->outputDev[output].width;
oh = s->outputDev[output].height;
}
+ // Prevent zoom from going below 1.0 ever -- fixes annoying bounce during zoom cancel
+ if (zs->xscale < 1.0)
+ {
+ zs->zVelocity = 0.0;
+ zs->xscale = 1.0;
+ }
+ if (zs->yscale < 1.0)
+ {
+ zs->zVelocity = 0.0;
+ zs->yscale = 1.0;
+ }
float tx = zs->mouseX - (ox + (ow / 2.0));
float ty = zs->mouseY - (oy + (oh / 2.0));