rotate: fix crash when image origin is not (0,0)
parent
d63b461ecf
commit
2608224b47
|
@ -41,7 +41,8 @@ rot90(Memimage *m)
|
||||||
|
|
||||||
dx = Dx(m->r);
|
dx = Dx(m->r);
|
||||||
dy = Dy(m->r);
|
dy = Dy(m->r);
|
||||||
if((w = allocmemimage(Rect(m->r.min.x, m->r.min.y, dy, dx), m->chan)) == nil)
|
if((w = allocmemimage(Rect(m->r.min.x, m->r.min.y,
|
||||||
|
m->r.min.x+dy, m->r.min.y+dx), m->chan)) == nil)
|
||||||
sysfatal("allocmemimage: %r");
|
sysfatal("allocmemimage: %r");
|
||||||
line = w->width*sizeof(ulong);
|
line = w->width*sizeof(ulong);
|
||||||
for(y=0; y<dy; y++){
|
for(y=0; y<dy; y++){
|
||||||
|
|
Loading…
Reference in New Issue