shithub: riscv

Download patch

ref: 9582ef60df4f7d633827834efd19d8774f13d23f
parent: cd2a8951ce0ba05f6d2540ea3dbe26be5eb627d8
author: cinap_lenrek <[email protected]>
date: Thu Feb 9 01:14:36 EST 2012

page: can't just cover whole display

--- a/sys/src/cmd/page.c
+++ b/sys/src/cmd/page.c
@@ -160,10 +160,14 @@
 	/* add rio border */
 	size = addpt(size, Pt(Borderwidth*2, Borderwidth*2));
 	if(display->image){
-		if(size.x > Dx(display->image->r))
-			size.x = Dx(display->image->r);
-		if(size.y > Dy(display->image->r))
-			size.y = Dy(display->image->r);
+		Point dsize = subpt(display->image->r.max, display->image->r.min);
+		if(size.x > dsize.x)
+			size.x = dsize.x;
+		if(size.y > dsize.y)
+			size.y = dsize.y;
+		/* can't just conver whole display */
+		if(eqpt(size, dsize))
+			size.y--;
 	}
 	fprint(wctl, "resize -dx %d -dy %d\n", size.x, size.y);
 	close(wctl);