paint: restore color channel on undo after conversion thru pipe

converting image thru pipe would not properly restore the
original color channel on undo. like |iconv -c k8 would
still be grayscale after undo.
This commit is contained in:
cinap_lenrek 2013-06-26 02:27:35 +02:00
parent 5165864dbb
commit b3e120ecb6

View file

@ -259,10 +259,16 @@ restore(int n)
if((tmp = undo[x]) == nil) if((tmp = undo[x]) == nil)
return; return;
undo[x] = nil; undo[x] = nil;
expand(tmp->r); if(canvas != nil && canvas->chan != tmp->chan){
draw(canvas, tmp->r, tmp, nil, tmp->r.min); freeimage(canvas);
update(&tmp->r); canvas = tmp;
freeimage(tmp); update(nil);
} else {
expand(tmp->r);
draw(canvas, tmp->r, tmp, nil, tmp->r.min);
update(&tmp->r);
freeimage(tmp);
}
} }
} }