ref: c7bad8f0e57cca31bc7e7fa162b578b177f4ec37
parent: 35fde3591ff2396accb07eeeca51199698a626c3
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Sep 20 05:15:53 EDT 2016
rio: fix onscreen()
--- a/sys/src/cmd/rio/rio.c
+++ b/sys/src/cmd/rio/rio.c
@@ -364,8 +364,6 @@
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 @@
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;
}