summaryrefslogtreecommitdiff
path: root/put.c
diff options
context:
space:
mode:
authorErkin Bahceci <erkinbah@gmail.com>2007-07-02 20:18:46 -0400
committerErkin Bahceci <erkinbah@gmail.com>2007-07-02 20:18:46 -0400
commitb9d7c2ef8753c8abb36d66a6ab2eff70a04fdf5b (patch)
tree686198317791cd089887056419650db266828d17 /put.c
parent4e3370f90a46a61d19449c6ad03538af16216105 (diff)
downloadput-b9d7c2ef8753c8abb36d66a6ab2eff70a04fdf5b.tar.gz
put-b9d7c2ef8753c8abb36d66a6ab2eff70a04fdf5b.tar.bz2
Fix the 1 pixel jump just before reaching target.
Diffstat (limited to 'put.c')
-rw-r--r--put.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/put.c b/put.c
index 6d3007c..f71bffb 100644
--- a/put.c
+++ b/put.c
@@ -175,8 +175,15 @@ static void putPreparePaintScreen(CompScreen * s, int msSinceLastPaint)
pw->tx += pw->xVelocity * chunk;
pw->ty += pw->yVelocity * chunk;
- dx = (pw->lastX + pw->tx) - pw->x;
- dy = (pw->lastY + pw->ty) - pw->y;
+ int adjx =
+ (pw->xVelocity > 0 ? 1 :
+ pw->xVelocity < 0 ? -1 : 0);
+ int adjy =
+ (pw->yVelocity > 0 ? 1 :
+ pw->yVelocity < 0 ? -1 : 0);
+
+ dx = (pw->lastX + pw->tx + adjx) - pw->x;
+ dy = (pw->lastY + pw->ty + adjy) - pw->y;
moveWindow(w, dx, dy, TRUE, TRUE);