https://bugs.kde.org/show_bug.cgi?id=440938

            Bug ID: 440938
           Summary: Krita crashes after resizing brush in a specific way
           Product: krita
           Version: 4.4.7
          Platform: Microsoft Windows
                OS: Microsoft Windows
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: General
          Assignee: krita-bugs-n...@kde.org
          Reporter: odraenco...@gmail.com
  Target Milestone: ---

SUMMARY

If a brush is resized inside the brush editor and outside of it too much,
repeatedly, Krita crashes. This is due to the masked brush's brush tip diameter
becoming too large.

Krita always generates a mask for the masked brush's brush tip diameter when
loading the brush, even if the masked brush's "brush tip" entry in the brush
editor is toggled off.

The diameter of the masked brush is supposed to scale proportionally to the
diameter of the actual brush. For example, if the brush diameter is 2px, and
the masked brush diameter is 3px, and you use the slider in the toolbar to
resize the brush to 10px, making it 5x bigger, then the masked brush diameter
also gets 5x bigger, becoming 15px.

Using hotkeys, shift dragging, or using the diameter slider in the toolbar all
have this effect of resizing the masked brush diameter proportionally. This
occurs EVEN if the masked brush "brush tip" entry is toggled off.

However, setting the brush diameter in the brush editor doesn't affect the
masked brush diameter.

As a consequence, if you start with a brush that has 1px/1px brush/masked brush
diameters, and resize it with the toolbar to 1000px/1000px, then open the brush
editor and reset the brush diameter to 1px, you end up with 1px/1000px
brush/masked brush diameters. This time, if you use the toolbar to resize it to
1000px, you should end up with 1000px/1000000px brush/masked brush diameters.
Repeat this enough times and the masked brush diameter overflows. This occurs
even if the user isn't using the masked brush feature at all, completely
without his knowledge.

It's also possible that you end up saving the brush with an extremely large
masked brush size, so it will lag to load whens witching to the custom brush,
and you'll have no idea it's because of the masked brush diameter since you
didn't even toggle the masked brush setting on.


STEPS TO REPRODUCE
1. select the b)_Basic-5_Size, open the brush editor, click save new brush
preset and call it "test" or something.
2. select the test brush, open the brush editor, set the brush diameter to 1px.
3. leave the brush editor, use the diameter slider in the toolbar, hotkeys, or
shift drag to resize the brush to 1000px.
4. open the brush editor, set the brush diameter to 1px.
5. leave the brush editor, resize the brush to 1000px again.
6. repeat 4, 5 a couple of times.

Alternatively:
6. open the brush editor. Click overwrite brush.
7. select any other brush, e.g. a)_Eraser_Circle.
8. select the test brush.

OBSERVED RESULT

Krita crashed.

Alternatively: there's a noticeable delay switching to the saved custom brush.
It gets more noticeable the worse your computer is.

EXPECTED RESULT

No crashing. No delay.

SOFTWARE/OS VERSIONS
Windows: 7
Qt Version: 5.14.11

ADDITIONAL INFORMATION

The same problem was reported in bug 423572.

Even if the crash issue is addressed, there's also the issue of custom brushes
saved with enormous mask diameters that the user is unaware of appearing to lag
or sometimes make Krita hang when switched to.

I think it makes more sense to not change the masked brush diameter if it's a
brush that isn't making use of masked brushes in first place. I don't know why
Krita appears to take a while generating a mask for the masked brush even when
the masked brush is disabled. I guess normally the masked brush is so small
it's a negligible delay?

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to