From 9f54b9718e1af24fdcdb869eea44705e45733c02 Mon Sep 17 00:00:00 2001 From: Matthew Wilber Date: Mon, 22 Dec 2003 01:39:01 +0000 Subject: [PATCH] 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 --- src/apps/showimage/ShowImageView.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/apps/showimage/ShowImageView.cpp b/src/apps/showimage/ShowImageView.cpp index c2c6a1c711..ea8ea79232 100644 --- a/src/apps/showimage/ShowImageView.cpp +++ b/src/apps/showimage/ShowImageView.cpp @@ -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) {