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
+11 -3
View File
@@ -1922,7 +1922,7 @@ ShowImageView::SetSlideShowDelay(float seconds)
settings->SetInt32("SlideShowDelay", fSlideShowDelay); settings->SetInt32("SlideShowDelay", fSlideShowDelay);
settings->Unlock(); settings->Unlock();
} }
} }
} }
void void
@@ -1984,8 +1984,10 @@ void
ShowImageView::Rotate(int degree) ShowImageView::Rotate(int degree)
{ {
if (degree == 90) { if (degree == 90) {
fUndo.Clear();
DoImageOperation(ImageProcessor::kRotateClockwise); DoImageOperation(ImageProcessor::kRotateClockwise);
} else if (degree == 270) { } else if (degree == 270) {
fUndo.Clear();
DoImageOperation(ImageProcessor::kRotateAntiClockwise); DoImageOperation(ImageProcessor::kRotateAntiClockwise);
} }
} }
@@ -1993,6 +1995,7 @@ ShowImageView::Rotate(int degree)
void void
ShowImageView::Mirror(bool vertical) ShowImageView::Mirror(bool vertical)
{ {
fUndo.Clear();
if (vertical) { if (vertical) {
DoImageOperation(ImageProcessor::kMirrorVertical); DoImageOperation(ImageProcessor::kMirrorVertical);
} else { } else {
@@ -2003,10 +2006,15 @@ ShowImageView::Mirror(bool vertical)
void void
ShowImageView::Invert() 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 void
ShowImageView::SetIcon(bool clear, icon_size which) ShowImageView::SetIcon(bool clear, icon_size which)
{ {