diff --git a/libs/image/kis_pixel_selection.cpp b/libs/image/kis_pixel_selection.cpp index 9686980..a6980f5 100644 --- a/libs/image/kis_pixel_selection.cpp +++ b/libs/image/kis_pixel_selection.cpp @@ -151,7 +151,7 @@ void KisPixelSelection::applySelection(KisPixelSelectionSP selection, SelectionA intersectSelection(selection); break; case SELECTION_SYMMETRICDIFFERENCE: - symmetricdifferenceSelection(selection); + symmetricDifferenceSelection(selection); break; default: break; @@ -258,7 +258,7 @@ void KisPixelSelection::intersectSelection(KisPixelSelectionSP selection) m_d->invalidateThumbnailImage(); } -void KisPixelSelection::symmetricdifferenceSelection(KisPixelSelectionSP selection) +void KisPixelSelection::symmetricDifferenceSelection(KisPixelSelectionSP selection) { QRect r = selection->selectedRect(); if (r.isEmpty()) return; @@ -268,7 +268,7 @@ void KisPixelSelection::symmetricdifferenceSelection(KisPixelSelectionSP selecti KisHLineConstIteratorSP src = selection->createHLineConstIteratorNG(r.x(), r.y(), r.width()); for (int i = 0; i < r.height(); ++i) { do { - abs(*dst->rawData() - *src->oldRawData()); + *dst->rawData() = abs(*dst->rawData() - *src->oldRawData()); } while (src->nextPixel() && dst->nextPixel()); dst->nextRow(); diff --git a/libs/image/kis_pixel_selection.h b/libs/image/kis_pixel_selection.h index 171642d..afca308 100644 --- a/libs/image/kis_pixel_selection.h +++ b/libs/image/kis_pixel_selection.h @@ -156,7 +156,7 @@ private: /** * Invert a selection or intersect with the inverse of a selection */ - void symmetricdifferenceSelection(KisPixelSelectionSP selection); + void symmetricDifferenceSelection(KisPixelSelectionSP selection); private: // We don't want these methods to be used on selections: diff --git a/libs/ui/tool/kis_selection_tool_helper.cpp b/libs/ui/tool/kis_selection_tool_helper.cpp index 50281fc..c2cd588 100644 --- a/libs/ui/tool/kis_selection_tool_helper.cpp +++ b/libs/ui/tool/kis_selection_tool_helper.cpp @@ -101,12 +101,12 @@ void KisSelectionToolHelper::selectPixelSelection(KisPixelSelectionSP selection, KisPixelSelectionSP pixelSelection = m_view->selection()->pixelSelection(); KIS_ASSERT_RECOVER(pixelSelection) { return 0; } - bool hasSelection = !pixelSelection->isEmpty(); + const bool hasSelection = !pixelSelection->isEmpty(); KisSelectionTransaction transaction(pixelSelection); if (!hasSelection && m_action == SELECTION_SYMMETRICDIFFERENCE) { - pixelSelection->invert(); + m_action = SELECTION_REPLACE; } pixelSelection->applySelection(m_selection, m_action);