summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@opencompositing.org>2008-02-05 16:42:31 +0100
committerDennis kasprzyk <onestone@opencompositing.org>2008-02-05 16:42:31 +0100
commitb437c28ea733f59e15633499d0dc026228d6f180 (patch)
treea24cbaef0e1319bf8ba9460e559e575c8fbeb1c1
parent4be04dba377f655597c8c57dcc2400efd352be8d (diff)
downloadmag-b437c28ea733f59e15633499d0dc026228d6f180.tar.gz
mag-b437c28ea733f59e15633499d0dc026228d6f180.tar.bz2
Fixed "Keep always on screen mode".
-rw-r--r--mag.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/mag.c b/mag.c
index 441edde..04723bb 100644
--- a/mag.c
+++ b/mag.c
@@ -495,12 +495,20 @@ magPaintSimple (CompScreen *s)
cx = (w - cw) / 2;
cy = (h - ch) / 2;
- cx -= (x1 - (ms->posX - (w / 2))) / ms->zoom;
- cy += (y1 - (ms->posY - (h / 2))) / ms->zoom;
-
cx = MAX (0, MIN (w - cw, cx));
cy = MAX (0, MIN (h - ch, cy));
+ if (x1 != (ms->posX - (w / 2)))
+ {
+ cx = 0;
+ cw = w;
+ }
+ if (y1 != (ms->posY - (h / 2)))
+ {
+ cy = 0;
+ ch = h;
+ }
+
glEnable (ms->target);
glBindTexture (ms->target, ms->texture);