From 77982ded19b7d5180d3faeb2c85b8b01925eff59 Mon Sep 17 00:00:00 2001 From: Ryan Leavengood Date: Thu, 13 May 2010 04:28:57 +0000 Subject: [PATCH] Fix #5808. I'm not completely happy with this solution, but it fixes the problem without a bunch of refactoring. I intend to do more refactoring of ShowImage after developing an automated test suite. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36800 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/showimage/ShowImageView.cpp | 7 ++++--- src/apps/showimage/ShowImageView.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/apps/showimage/ShowImageView.cpp b/src/apps/showimage/ShowImageView.cpp index d43e647032..f73b6453a8 100644 --- a/src/apps/showimage/ShowImageView.cpp +++ b/src/apps/showimage/ShowImageView.cpp @@ -2014,7 +2014,7 @@ ShowImageView::_AddWhiteRect(BRect &rect) void -ShowImageView::_RemoveSelection(bool toClipboard) +ShowImageView::_RemoveSelection(bool toClipboard, bool neverCutBackground) { if (!_HasSelection()) return; @@ -2029,7 +2029,7 @@ ShowImageView::_RemoveSelection(bool toClipboard) _SetHasSelection(false); - if (cutBackground) { + if (!neverCutBackground && cutBackground) { // If the user hasn't dragged the selection, // paint a white rectangle where the selection was restore = _CopyFromRect(rect); @@ -2111,7 +2111,8 @@ ShowImageView::ClearSelection() { // Remove the selection, // DON'T copy it to the clipboard - _RemoveSelection(false); + // or white out the selection + _RemoveSelection(false, true); } diff --git a/src/apps/showimage/ShowImageView.h b/src/apps/showimage/ShowImageView.h index 5a1488d084..54ed2778c5 100644 --- a/src/apps/showimage/ShowImageView.h +++ b/src/apps/showimage/ShowImageView.h @@ -132,7 +132,7 @@ class ShowImageView : public BView { }; void _InitPatterns(); void _RotatePatterns(); - void _RemoveSelection(bool bToClipboard); + void _RemoveSelection(bool bToClipboard, bool neverCutBackground = false); bool _HasSelection() { return fHasSelection; } void _SetHasSelection(bool bHasSelection); void _AnimateSelection(bool a);