Commit ff5295f7 authored by Agata Cacko's avatar Agata Cacko
Browse files

Optimize KisToolSelectSimilar for Color Labeled Layers

Before this commit, KisToolSelectSimilar in Color Labeled Layers mode
would use the whole image bounds area to calculate the selection.
This commit ensures that the areas outside of bounds of the source
device are not processed unnecessarily.

CCBUG:428441
parent 6629a821
......@@ -187,7 +187,10 @@ void KisToolSelectSimilar::beginPrimaryAction(KoPointerEvent *event)
[fuzziness, tmpSel, sourceDevice, patch, color] () mutable -> KUndo2Command* {
QRect patchRect = *patch.data();
selectByColor(sourceDevice, tmpSel, color->data(), fuzziness, patchRect);
QRect finalRect = patchRect.intersected(sourceDevice->exactBounds());
if (!finalRect.isEmpty()) {
selectByColor(sourceDevice, tmpSel, color->data(), fuzziness, patchRect);
}
return 0;
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment