• Dmitry Kazakov's avatar
    Implement dependent size changes for the Masking Brush · a641fec9
    Dmitry Kazakov authored
    Now the masking brush changes according to these requirements:
    1) When the brush size is changed in the brush editor, masking
       brush size is kept unchanged
    2) When the brush size is changed using quick-controls, that is
       toolbox slider, shift+gesture, HUD display, the masking brush size
       is changed proportionally.
    3) Technically, the masking brush supports disabling this "dependent
       size" functionality, but I'm not sure if it should be visible in GUI.
       It is already overcomplicated.
    Technical changes:
    1) Now the brushes are always **copied** when fetched from the
       brushes registry. That is, if you load the brush using
       KisBrush::fromXML(), you will always have your own copy of the
       brush object, not shared with the one in the server.
    2) For the efficiency reasons, the brush tip QImage will be lazily
       shared with the one on the server using the Qt's internal algorithm.
       If you change the brush tip in you copy of the brush, Qt will deep-
       copy the corresponding QImage.
    3) For the efficiency reasons, brush mipmap pyramid (KisQImagePyramid)
       is also shared among all the instances of the brush with
       the same brush tip QImage. Every time one changes the instance of
       the brush, the pyramid object is detached and reset. This basic
       lazy copying algorithm is implemented in KisSharedQImagePyramid.
kis_auto_brush_factory.cpp 1.99 KB