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:
parent
5165864dbb
commit
b3e120ecb6
1 changed files with 10 additions and 4 deletions
|
@ -259,10 +259,16 @@ restore(int n)
|
|||
if((tmp = undo[x]) == nil)
|
||||
return;
|
||||
undo[x] = nil;
|
||||
expand(tmp->r);
|
||||
draw(canvas, tmp->r, tmp, nil, tmp->r.min);
|
||||
update(&tmp->r);
|
||||
freeimage(tmp);
|
||||
if(canvas != nil && canvas->chan != tmp->chan){
|
||||
freeimage(canvas);
|
||||
canvas = tmp;
|
||||
update(nil);
|
||||
} else {
|
||||
expand(tmp->r);
|
||||
draw(canvas, tmp->r, tmp, nil, tmp->r.min);
|
||||
update(&tmp->r);
|
||||
freeimage(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue