Bug 392312

Summary: Color smudge engine breaks when smudging outside the image bounds in wrap around mode
Product: [Applications] krita Reporter: Dennis Ranke <dennis.ranke>
Component: Brush enginesAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: brummerke90, halla
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Smudging right to left from inside the image bounds to outside

Description Dennis Ranke 2018-03-25 15:22:35 UTC
Created attachment 111634 [details]
Smudging right to left from inside the image bounds to outside

When smudging outside the image bounds with wrap mode enabled, the brush engine picks overwrites the image data at the brush dab rect with transparency. (see attachment)

As far as I can tell, this is caused by KisPrecisePaintDeviceWrapper::readRects clamping the rects to the device extent without regard to the wrap around mode. Creating correctly wrapped rects before clamping appears to fix this issue.
Comment 1 Halla Rempt 2018-03-28 12:16:24 UTC
Patch here: https://phabricator.kde.org/D11689
Comment 2 Halla Rempt 2018-03-28 12:17:01 UTC
Assigning to dmitry since he will have to review the patch.
Comment 3 Dmitry Kazakov 2018-03-28 14:33:54 UTC
Git commit f32ac392795422d7e735181bab7664c93a4e6db2 by Dmitry Kazakov, on behalf of Dennis Ranke.
Committed on 28/03/2018 at 14:32.
Pushed by dkazakov into branch 'master'.

fix precise paint device wrapper readRects in wrap around mode

Summary:
KisPrecisePaintDeviceWrapper::readRects clamped the input rects to the device extents without regard to the wrap around mode. So if a rect is passed that is outside the image bounds, it is clamped to be zero sized and nothing is read instead of reading from the wrapped position.

This causes all color smudge brushes to be broken when used outside the image bounds in wrap around mode.

This change adds a case for wrap around mode which correctly wraps the rect before clamping.

Reviewers: #krita, dkazakov

Reviewed By: #krita, dkazakov

Subscribers: rempt, alvinhochun, dkazakov

Differential Revision: https://phabricator.kde.org/D11689

M  +14   -4    libs/image/KisPrecisePaintDeviceWrapper.cpp

https://commits.kde.org/krita/f32ac392795422d7e735181bab7664c93a4e6db2
Comment 4 wolthera 2018-03-29 14:22:59 UTC
*** Bug 392489 has been marked as a duplicate of this bug. ***
Comment 5 Halla Rempt 2018-04-03 11:46:59 UTC
Git commit 616b4d0aee8bc9ec60a59a4eabdfcbcb558abf82 by Boudewijn Rempt, on behalf of Dennis Ranke.
Committed on 03/04/2018 at 11:18.
Pushed by rempt into branch 'krita/4.0'.

fix precise paint device wrapper readRects in wrap around mode

Summary:
KisPrecisePaintDeviceWrapper::readRects clamped the input rects to the device extents without regard to the wrap around mode. So if a rect is passed that is outside the image bounds, it is clamped to be zero sized and nothing is read instead of reading from the wrapped position.

This causes all color smudge brushes to be broken when used outside the image bounds in wrap around mode.

This change adds a case for wrap around mode which correctly wraps the rect before clamping.

Reviewers: #krita, dkazakov

Reviewed By: #krita, dkazakov

Subscribers: rempt, alvinhochun, dkazakov

Differential Revision: https://phabricator.kde.org/D11689

(cherry picked from commit f32ac392795422d7e735181bab7664c93a4e6db2)

M  +14   -4    libs/image/KisPrecisePaintDeviceWrapper.cpp

https://commits.kde.org/krita/616b4d0aee8bc9ec60a59a4eabdfcbcb558abf82