summaryrefslogtreecommitdiff
path: root/sys/src/cmd/rio
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-09-20 09:15:53 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-09-20 09:15:53 +0200
commitc7bad8f0e57cca31bc7e7fa162b578b177f4ec37 (patch)
tree240f6b7c4029221f411f998301fd6c81556e7976 /sys/src/cmd/rio
parent35fde3591ff2396accb07eeeca51199698a626c3 (diff)
rio: fix onscreen()
Diffstat (limited to 'sys/src/cmd/rio')
-rw-r--r--sys/src/cmd/rio/rio.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/src/cmd/rio/rio.c b/sys/src/cmd/rio/rio.c
index a063b2b0f..0fc5e4f53 100644
--- a/sys/src/cmd/rio/rio.c
+++ b/sys/src/cmd/rio/rio.c
@@ -364,8 +364,6 @@ inborder(Rectangle r, Point xy)
Rectangle
whichrect(Rectangle r, Point p, int which)
{
- p.x = min(p.x, screen->clipr.max.x-1);
- p.y = min(p.y, screen->clipr.max.y-1);
switch(which){
case 0: /* top left */
r = Rect(p.x, p.y, r.max.x, r.max.y);
@@ -842,9 +840,9 @@ Point
onscreen(Point p)
{
p.x = max(screen->clipr.min.x, p.x);
- p.x = min(screen->clipr.max.x, p.x);
+ p.x = min(screen->clipr.max.x-1, p.x);
p.y = max(screen->clipr.min.y, p.y);
- p.y = min(screen->clipr.max.y, p.y);
+ p.y = min(screen->clipr.max.y-1, p.y);
return p;
}