Home
Phabricator
Search
Log In
Paste
P261
Masterwork From Distant Lands
Active
Public
Actions
Authored by
dkazakov
on Sep 19 2018, 8:44 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
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);
dkazakov
edited the content of this paste.
(Show Details)
Sep 19 2018, 8:44 AM
dkazakov
changed the title of this paste from untitled to
Masterwork From Distant Lands
.
dkazakov
mentioned this in
D15085: Symmetric Difference Selection Patch for Krita
.
Sep 19 2018, 8:45 AM
Log In to Comment