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)
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue