ref: 9cef48284e4218ef4fd7d858a4cde940621814f9
parent: ecab1a3d8ce12f83dd12067774eb8b2d4d62533d
author: phil9 <telephil9@gmail.com>
date: Tue May 7 06:43:36 EDT 2024
vcrop: fix image panning
--- a/sys/src/cmd/vcrop.c
+++ b/sys/src/cmd/vcrop.c
@@ -172,6 +172,8 @@
a[Eresize].c = mctl->resizec;
a[Ekeyboard].c = kctl->c;
bg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xCCCCCCFF);
+ if(bg==nil)
+ sysfatal("allocimage: %r");n = readimage(display, fd, 0);
if(n==nil)
sysfatal("readimage: %r");@@ -185,9 +187,8 @@
case Emouse:
if(m.buttons==1){ for(;;) {- o = m.xy;
- if(!readmouse(mctl))
- break;
+ o = mctl->xy;
+ readmouse(mctl);
if((mctl->buttons & 1) == 0)
break;
translate(subpt(mctl->xy, o));
--
⑨