Cleared the Undo buffer when actions that are reversable are performed. Disabled Invert command for B_CMAP8 bitmaps, as they are not properly inverted

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5720 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matthew Wilber 2003-12-22 01:39:01 +00:00
parent 75238186d7
commit 9f54b9718e

View File

@ -1922,7 +1922,7 @@ ShowImageView::SetSlideShowDelay(float seconds)
settings->SetInt32("SlideShowDelay", fSlideShowDelay);
settings->Unlock();
}
}
}
}
void
@ -1984,8 +1984,10 @@ void
ShowImageView::Rotate(int degree)
{
if (degree == 90) {
fUndo.Clear();
DoImageOperation(ImageProcessor::kRotateClockwise);
} else if (degree == 270) {
fUndo.Clear();
DoImageOperation(ImageProcessor::kRotateAntiClockwise);
}
}
@ -1993,6 +1995,7 @@ ShowImageView::Rotate(int degree)
void
ShowImageView::Mirror(bool vertical)
{
fUndo.Clear();
if (vertical) {
DoImageOperation(ImageProcessor::kMirrorVertical);
} else {
@ -2003,10 +2006,15 @@ ShowImageView::Mirror(bool vertical)
void
ShowImageView::Invert()
{
DoImageOperation(ImageProcessor::kInvert);
if (fBitmap->ColorSpace() != B_CMAP8) {
// Only allow an invert operation if the
// bitmap color space is supported by the
// invert algorithm
fUndo.Clear();
DoImageOperation(ImageProcessor::kInvert);
}
}
void
ShowImageView::SetIcon(bool clear, icon_size which)
{