Bug 399065 - Halftone filter broken and Stamp option in predefined brush editor using wrong bounds due bug with KisPaintDevice::crop
Summary: Halftone filter broken and Stamp option in predefined brush editor using wron...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Unclassified
Component: Tools (show other bugs)
Version: git master (please specify the git hash!)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-25 17:26 UTC by wolthera
Modified: 2018-09-26 16:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wolthera 2018-09-25 17:26:50 UTC
SUMMARY
Okay, this one's one I researched myself.

I was trying to figure out why Stamp in the predefined brushes looked weird.

STEPS TO REPRODUCE
1. Open an image
2. make a selection smaller than the total canvas size.
3. go to brush editor(f5)
3.1. go to brush tip
3.2. go to predefined brushes
4. Select stamp.
5. Observe that the ratio is all wrong.

STEPS TO REPRODUCE 2:
1. Open an image.
2. Apply filters->artistic->halftone filer.
3. Observe it looking weird.

After some investigation this is caused by KisPaintDevice::crop(QRect) not actually cropping the device boundaries. Using KisPaintDevice::crop(int x, int y, int w, int h) does work. The two functions also do something different.

So the reason I am not actually just writing a patch for this is because I feel that crop(QRect) is named falsely, and should be a different function. Especially as it seems it's functionality used to be the same as KisPaintDevice::crop(int x, int y, int w, int h). However, I cannot determine why it changed, so I cannot come up with a new name.
Comment 1 Dmitry Kazakov 2018-09-26 11:13:01 UTC
Hi, Wolthera!

Could you tell what exactly does it mean "3. Observe it looking weird."? On my build the filter result looks correct and the only problem of the stamp brush I see is that the thumbnail has wrong aspect ratio. But the brush itself paints correctly...
Comment 2 Dmitry Kazakov 2018-09-26 11:33:58 UTC
Git commit 8dcacba3ed052911bc41df9cac96ee4e7a95057e by Dmitry Kazakov.
Committed on 26/09/2018 at 11:33.
Pushed by dkazakov into branch 'master'.

Make Stamp brush preview be scaled correctly

M  +14   -7    plugins/paintops/libpaintop/kis_custom_brush_widget.cpp
M  +1    -0    plugins/paintops/libpaintop/kis_custom_brush_widget.h

https://commits.kde.org/krita/8dcacba3ed052911bc41df9cac96ee4e7a95057e
Comment 3 Dmitry Kazakov 2018-09-26 11:36:44 UTC
Git commit 96bc1223072279dea70a1cca204a2b7cb1366434 by Dmitry Kazakov.
Committed on 26/09/2018 at 11:36.
Pushed by dkazakov into branch 'krita/4.1'.

Make Stamp brush preview be scaled correctly

M  +14   -7    plugins/paintops/libpaintop/kis_custom_brush_widget.cpp
M  +1    -0    plugins/paintops/libpaintop/kis_custom_brush_widget.h

https://commits.kde.org/krita/96bc1223072279dea70a1cca204a2b7cb1366434
Comment 4 wolthera 2018-09-26 16:29:41 UTC
I can't reproduce the halftone problem today, how weird.