1. 24 Aug, 2019 1 commit
  2. 23 Aug, 2019 1 commit
    • Tusooa Zhu's avatar
      Fix a crash when editing calligraphic shape · 5afd7216
      Tusooa Zhu authored
      We have to put a lock there because when editing calligraphic shape,
      KoPathTool::paint() from the gui thread fetches the points from the shape,
      but the points may at the same time be deleted by karbonSimplifyPath()
      in the image thread.
      5afd7216
  3. 19 Aug, 2019 1 commit
  4. 18 Aug, 2019 3 commits
    • Tusooa Zhu's avatar
      Move KoPathTool to plugins · 076e5443
      Tusooa Zhu authored
      We need to move KoPathTool to the plugins directory since
      the interaction strategies for the new system would depend on,
      at least, kritaimage. Image depends on flake so the tool cannot
      stay in flake.
      
      The unit test for KoPathTool is temporarily disabled.
      076e5443
    • Tusooa Zhu's avatar
      Port gradient editing and some related actions to stroke system · 25ef8108
      Tusooa Zhu authored
      We created an abstract class KoCanvasStrokeHelperBase to handle
      the actions to be executed in a stroke, and derived from it in
      kritaui, mainly because flake cannot depend on image.
      25ef8108
    • Tusooa Zhu's avatar
      Move the stroke system to a separate directory · e9b187cd
      Tusooa Zhu authored
      Flake will nonetheless have to make use of the stroke system.
      We cannot link kritaimage to kritaflake, since the former one
      depends on the latter indirectly.
      e9b187cd
  5. 13 Jul, 2019 1 commit
  6. 06 Oct, 2018 1 commit
  7. 31 Jul, 2018 1 commit
  8. 02 Jul, 2018 1 commit
    • Anna Medonosová's avatar
      Gamut masking for the artistic color selector · dbe05327
      Anna Medonosová authored
      Summary:
      Implementation of bug [[ https://bugs.kde.org/show_bug.cgi?id=391210 | 391210 ]].
      
      There is a feature that was not in the design document: the user can set mask strictness in the selector settings to either enforcing (only swatches inside the mask are available for the user to choose) or permissive, "just show the shapes", which only paints the shapes on top of the wheel but does not restrict color picking in any way.
      
      Contrary to the design document, there is no stand-alone mask editor. Instead, when user clicks the edit button, a template opens as a regular view which can be modified, previewed and saved.
      
      **Bugs**
        - ArtColorSel: When initializing the selector for the first time (empty configuration), the wheel segment values are not right
      
      **Smaller tweaks**
        - icon for gamut masking
        - GamutMask: better template design
            - group layer, gray l. with vector on top set to erase
            - set explicit stroke (black) and background (solid transparent) for shapes on preview/save; set fill to white on load to editor, so the erase blend mode works
      
      **Pre-launch**
        - Create user documentation
        - Create pre-made masks, some for basic color harmonies and something fancy to showcase the possibilities
      
      Reviewers: #krita, dkazakov
      
      Subscribers: dkazakov, rempt
      
      Tags: #krita
      
      Differential Revision: https://phabricator.kde.org/D13525
      dbe05327
  9. 24 Apr, 2018 1 commit
    • Dmitry Kazakov's avatar
      Fix crashes on undo/redo of vector path points operations · 25a628eb
      Dmitry Kazakov authored
      1) KoPathToolSelection keeps pointers to the shapes and its path points,
         therefore it should subscribe to the updates on the shapes and their
         points (using ShapeChangeListener framework).
      
      2) The patch also fixes a lot of bugs in "Join by segment" and
         "Merge points", which should behave correctly now.
      
      3) The patch also partially implements "keep path point selection"
         idea, which selects newly created point after each operation. The
         stuff is achieved using KoPathShape::PointSelectionChangeListener
         listener.
      
      BUG:393209
      BUG:393087
      25a628eb
  10. 21 Feb, 2018 1 commit
  11. 01 Feb, 2018 1 commit
    • Dmitry Kazakov's avatar
      Fix loading of SVGs embedded into ODG by Krita 3.0 · 603c9a0c
      Dmitry Kazakov authored
      This patch basically deprecates KoUnavailShape and tries to load
      the embedded SVGs directly. Theoretically, some raster images could
      also be included into ODG document and handled by unavail-shape, but
      most probably it has never been used, because ImageShape was always
      disabled in 3.x
      
      CCBUG:389271
      603c9a0c
  12. 06 Dec, 2017 1 commit
  13. 22 Jun, 2017 1 commit
  14. 20 Jun, 2017 1 commit
  15. 09 Jun, 2017 2 commits
  16. 08 Jun, 2017 1 commit
  17. 07 Jun, 2017 1 commit
    • Boudewijn Rempt's avatar
      Add KoSvgSymbolCollectioNResource · 3a28b5e7
      Boudewijn Rempt authored
      This is a KoResource that can be created from the symbols in the
      defs section of an svg file. It will be compatible with the files
      inkscape uses for symbols.
      3a28b5e7
  18. 31 May, 2017 1 commit
  19. 22 May, 2017 1 commit
    • Dmitry Kazakov's avatar
      Implement basic loading of SVG text elements · fa0cf6fb
      Dmitry Kazakov authored
      The basic design is:
      
      1) Each element of the text (text, tspan) is represented with
         KoSvgTextChunkShape. This chunk stores all the information
         about this portion of the text. The properties are stored in
         KoSvgTextProperties object, that will allow us to export them
         as a markup.
      
      2) A subtree of test elements is stored in KoSvgTextShape, which
         is also a chunk.
      
      3) The main text shape accesses the internals of its chunks with
         KoSvgTextChunkShapeLayoutInterface. It encapsulates all the
         details that should not be accessed in public.
      
      4) A text chunk can be "a text" or "a node". In the latter case
         it is just an intermediate node that stores a set of children
         that actually have the text.
      
      5) The layout of the text is performed by KoSvgTextShape
      fa0cf6fb
  20. 20 Mar, 2017 2 commits
  21. 14 Mar, 2017 2 commits
    • Dmitry Kazakov's avatar
      Remove KoShapePaste and all the related classes · 7d8d2994
      Dmitry Kazakov authored
      This was an extremely weird system for cloning c++ object via ODF.
      Now everything is done via KoShape::cloneShape() and this patch just
      cleans up the leftovers of the old stuff.
      7d8d2994
    • Dmitry Kazakov's avatar
      Implement copy-pasting of shapes! · 1189dccb
      Dmitry Kazakov authored
      This patch implements the following:
      
      1) The shapes can be copy/pasted inside Krita
      2) The shapes can be copy/pasted Krita->Inkscape
         (reverse does not yet work)
      3) There are two shortcuts (reverse to Inkscape :( )
         Ctrl+V paste at original position
         Ctrl+Alt+V paste at cursor position
      
      CC:kimageshop@kde.org
      1189dccb
  22. 07 Mar, 2017 1 commit
    • Dmitry Kazakov's avatar
      Fix rendering of Wolthera's test SVG file · 16bd8188
      Dmitry Kazakov authored
      The problem happened because we rendered *all* the group layers
      *TWICE*! Once in the shape manager and the second time in the
      shape container itself. Now all the hierarchy rendering happens in
      in the shape manager only.
      16bd8188
  23. 06 Mar, 2017 1 commit
    • Dmitry Kazakov's avatar
      Fix dangling connections to the shape selection · 5a23ec0d
      Dmitry Kazakov authored
      1) In Krita we have a "weird" system, where KisCanvas2 switches shape
         managers depending the currently activated shape layer/selection.
         I call it "weird" not because it is bad, but because Flake system
         was not designed for that. Quite a lot of dockers and objects
         make connections to a KoSelection, and keep these connections
         throughout the entire run of Krita. That is wrong behavior in Krita.
      
      2) To solve the issue I created a special proxy object:
      
         KoCanvasBase::selectedShapesProxy()
      
         which has the same selection signals provided by KoSelection and
         KoShapeManager, but that is guaranteed to be persistent throughout
         the entire life of KoCanvasBase.
      5a23ec0d
  24. 27 Feb, 2017 1 commit
    • Boudewijn Rempt's avatar
      Delete KisView on closing a view. · 6f614b5f
      Boudewijn Rempt authored
      This first makes KoCanvasBase a QObject; that used to be impossible
      because other calligra applications canvas classes multiply inherited
      QWidget and KoCanvasBase. That is no longer a consideration.
      
      Then every local use of a pointer to KoCanvasBase or KisCanvas2 is
      protected by QPointer. Now every canvas observer knows when a canvas
      has disappeared.
      
      But the canvas is deleted before the canvascontroller widget; that means
      that when deleting the canvas, the canvas controller widget would get
      confused because the canvas observers' canvas has already been deleted:
      unsetCanvas wouldn't be called on the canvas observers, so the logic here
      is now that if unsetCanvas is called when deleting the canvas controller
      widget, unsetCanvas is always called on all observers.
      
      Note: no dockers crash even if unsetCanvas isn't called at the right time,
      but it's still proper to call unsetCanvas to allow dockers to clean up
      things like local models linked to the layer model.
      6f614b5f
  25. 18 Feb, 2017 1 commit
  26. 06 Feb, 2017 1 commit
  27. 30 Dec, 2016 1 commit
  28. 29 Dec, 2016 1 commit
  29. 29 Nov, 2016 1 commit
    • Dmitry Kazakov's avatar
      Implement KoShape::cloneShape() · 7699443c
      Dmitry Kazakov authored
      This is a mandatory function to be able to load shapes from SVG,
      because the same shape may be instantiated from different places.
      We still need to discuss whether we need to really "share" the
      shape template, but for now I just deep-copy them (which is the
      easiest because of shape normalization problem we have).
      
      There are the following drawbacks/hacks in this patch:
      
      1) Not all the shapes have KoShape::cloneShape() implemented! Basically,
         it is defined only for group shape and all the descendants of a path
         shape (which are the only shapes used in SVG). Other shapes use the
         default implementation which simply returns null.
      
         Ideally, there should be no default implementation and all the shapes
         should define it. But, given that we are going to deprecate quite a lot
         of stuff, I'll keep them just unimplemented for now.
      
      2) The following shape properties are not yet copied during cloning:
      
         * toolDelegates
         * dependees
         * shadow
         * border
         * filterEffectStack
      
         All the properties, except of tool delegates will probably be
         deprecated soon. And for the tool delegates we need to invent
         something ingenious to handle the pointers to recover pointers
         to the *cloned* shapes.
      
      3) I cannot guarantee TextShape's work anymore. I just blindly
         refactored it to use QScopedPointer to QTextDocument instead of
         the previous raw pointers trickery and never tested it. Hope it
         still works...
      7699443c
  30. 16 Nov, 2016 1 commit
    • Dmitry Kazakov's avatar
      Implemented clipping mask feature of SVG · deb9431b
      Dmitry Kazakov authored
      Still not implemented:
      1) Blending using linear RGB
      2) Doesn't work if a shape has a filter stack
      3) Shapes are leaking... but it should be fixed on the later
         stages of implementing SVG support. Right now shape ownership
         rules are not quite clear to me.
      4) Clip mask will not be found if placed into <def> category. *But*
         at the moment the <def> feature is implemented incorrectly. The
         inheritance of the 'def' elements should come from 'def', but not
         from the place of instantiation. So this part should be refactored
         anyway.
      deb9431b
  31. 01 Nov, 2016 1 commit
    • Dmitry Kazakov's avatar
      Implement rendering of SVG patterns · 68dbe96b
      Dmitry Kazakov authored
      There are a lot of weirdness in it, because every application
      renders patterns as it likes. Still result most of the test cases
      coincide with the one of Chrome and Firefox.
      68dbe96b
  32. 29 Oct, 2016 1 commit
  33. 07 Oct, 2016 1 commit
  34. 25 Jul, 2016 1 commit
    • Dmitry Kazakov's avatar
      A HUGE refactoring of KisPaintOpBox · 65fa65a9
      Dmitry Kazakov authored
      This patch introduces a lot of things:
      
      1) Implements a proper model-view-controller design for all the paintop
         preset-based properties, such as opacity, flow and size:
      
            Model --- KisPaintOpSettings
            Controller --- KoResourceManager (also tracks dependencies among
                           the preset and its derived properties, such as
                           opacity, size, flow, composite op)
            View --- KisPaintOpBox.
      
         Basically, it means that KisPaintOpBox doesn't write to the settings
         directly anymore. Instead, it uses KoResourceManager for that.
      
      2) Well, there are still a couple of flaws in the MVC design. E.g. the
         settings widgets still write directly into the settings bypassing the
         resource managers. To overcome this issue see the next bullet about
         KisResourceUpdateMediator. There is also a bigger problem, the size
         of the brush is still fetched through the access to the GUI elements,
         or, more precisely m_optionsWidget. I don't think it can be solved atm :(
      
      3) Adds KisResourceUpdateMediator. This is a special class that allows
         the resource manager to track the changes in complex resources, such as
         KisPaintOpPreset. When such resource changes internaly, all the derived
         resources get notification, and if they are also changed, a corresponding
         signal is emitted.
      
      
      There are still two regressions present:
      1) Locked Settings functionality doesn't work
      2) Resizing of the brush using Shift+Gesture is slow again :(
      65fa65a9
  35. 22 Apr, 2016 1 commit