1. 06 Jul, 2019 1 commit
  2. 05 Mar, 2019 1 commit
    • Agata Cacko's avatar
      Refactor KoUnit · 9d5baac8
      Agata Cacko authored
      Summary:
      This commit fixes two problems in KoUnit:
      (1) two functions named differently while doing
      nearly exactly the same thing (ptToUnit, toUserValue)
      and the difference in the name or arguments of functions
      not showing the difference in the results,
      (2) repeated constant values in functions
      called to[Unit] (i.e. toMillimeters).
      This commit is not to cause any difference in behaviour
      (including in particular converting and rounding values)
      and contains unit tests to test that.
      
      Test Plan:
      - created unit test to test the difference in conversions
      (should not none).
      - all the places where the difference in functions naming
      caused changes in files other than [Test]KoUnit.h/.cpp
      
      Reviewers: #krita, rempt
      
      Reviewed By: #krita, rempt
      
      Subscribers: rempt
      
      Tags: #krita
      
      Differential Revision: https://phabricator.kde.org/D19537
      9d5baac8
  3. 07 Oct, 2018 1 commit
  4. 23 Aug, 2018 1 commit
  5. 24 Jul, 2018 1 commit
  6. 26 Apr, 2018 1 commit
  7. 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
  8. 04 Apr, 2018 1 commit
  9. 19 Mar, 2018 1 commit
  10. 23 Feb, 2018 1 commit
  11. 13 Jan, 2018 1 commit
  12. 06 Jan, 2018 1 commit
  13. 09 Jun, 2017 1 commit
    • Boudewijn Rempt's avatar
      Simplify the add shapes docker · 46525e2b
      Boudewijn Rempt authored
      Now it doesn't have collections anymore, and everything is in one
      list. There aren't that many entries, and the whole collections
      idea was never implemented anyway.
      46525e2b
  14. 29 May, 2017 1 commit
  15. 25 May, 2017 1 commit
  16. 08 May, 2017 1 commit
  17. 09 Mar, 2017 1 commit
  18. 24 Feb, 2017 1 commit
  19. 18 Feb, 2017 2 commits
  20. 10 Feb, 2017 1 commit
  21. 29 Nov, 2016 2 commits
    • Dmitry Kazakov's avatar
    • 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
  22. 14 Sep, 2016 2 commits
    • Laurent Valentin Jospin's avatar
      Allow the user to change the active unit in the KisDoubleParseUnitSpinBoxes. · 74e30085
      Laurent Valentin Jospin authored
      I'm not sure it's worth merging now, but I want to get sure the design I choosed is not problematic.
      
      Ref T1621
      
      Summary:
      The main change, is the new class KisSpinBoxUnitManager. This is an abstract interface to let the spinboxes use different sorts of units from KoUnit, but also document relative lenght units (vw, vh), angle units and time units.
      
      This force some little tricks in the design, since the spinboxes must stay in the widget library, but a lot of needed info for relative units can't be acessed from this library.
      
      So the idea is to subclass the KisSpinBoxUnitManager where it can acess thoses datas, then send a pointer to the spinboxes. With polymorphism we can make all of this work.
      
      So now it's possible to change the unit by writing the symbol of this unit at the end of a KisDoubleParseUnitSpinBox.
      
      There's a few problem left, for example in some places the spinbox is destroyed and rebuilt everytime the user want to use it, so the active unit is not kept.
      
      There's also a few refactoring needed in a lot of places that use simple parse spinboxes with a suffix rather than unit spinbox.
      
      Test Plan:
      Activate all Karbon tool in your kritarc (not needed, But I've checked it works with them too).
      
      Launch krita
      
      Create a new document
      
      Create a new vector layer (the unit spinbox is used essentially for Karbon tools for the moment).
      
      You can try the freehand path and draw path karbon tool, set a size in any unit you want and start to draw.
      
      Then you can use the default tool (moving, resizing objects, setting a shadow). In all thoses steps you can use units like mm, cm, pt, ... but also px, vw, vh).
      
      Finally open the add shape and shape propeties docker. Add a few shapes and try to change the properties. deselect the shape reselect if, you'll found that the unit is reset to px (the spin box has been destroyed, then recreated).
      (I had a lots of problem with this docker, it needs a few refactoring to work with the new spinboxes).
      
      Close krita and check there's not segfault caused by the patch (I had this problem a few time, and had to find way to prevent it).
      
      Reviewers: #krita, dkazakov
      
      Subscribers: rempt
      
      Differential Revision: https://phabricator.kde.org/D2771
      74e30085
    • Laurent Valentin Jospin's avatar
      Create a static class with a builder to Let The KisDoubleParseUnitSpinBox... · e21cc006
      Laurent Valentin Jospin authored
      Create a static class with a builder to Let The KisDoubleParseUnitSpinBox build it's own unit manager possibly with a class from a library not linked to widget.
      
      This allow to have all UnitSpinBoxes uses the DocumentAware manager without traking and setting it everywhere in the code.
      e21cc006
  23. 07 Sep, 2016 1 commit
  24. 05 Aug, 2016 2 commits
    • Laurent Valentin Jospin's avatar
    • Laurent Valentin Jospin's avatar
      Create a replacement for KoUnitSpinBox that is able to parse math expression. · cfe61f40
      Laurent Valentin Jospin authored
      This class is more or less a copy of the KoUnitSpinBox class, but that inherit KisDoubleParseSpinBox instead of QDoubleSpinBox.
      
      It was impossible to use classes or functions from the ui library in the widget library du to dependance graph.
      So the best solution was to recreate the class in the ui lib.
      
      This class should be a base of work for the future conversions of units functions we want to add in the parser.
      From the discussion we had it will continue to be able to display the unit as a suffix,
      but should also be able to link with a combobox with a list of units. (still alowing to change the current unit on the keyboard).
      
      Tests where performed with the flake plugin.
      cfe61f40
  25. 03 Aug, 2016 1 commit
  26. 21 Jul, 2016 1 commit
    • Laurent Valentin Jospin's avatar
      Create a replacement for KoUnitSpinBox that is able to parse math expression. · 59d68b9d
      Laurent Valentin Jospin authored
      This class is more or less a copy of the KoUnitSpinBox class, but that inherit KisDoubleParseSpinBox instead of QDoubleSpinBox.
      
      It was impossible to use classes or functions from the ui library in the widget library du to dependance graph.
      So the best solution was to recreate the class in the ui lib.
      
      This class should be a base of work for the future conversions of units functions we want to add in the parser.
      From the discussion we had it will continue to be able to display the unit as a suffix,
      but should also be able to link with a combobox with a list of units. (still alowing to change the current unit on the keyboard).
      
      Tests where performed with the flake plugin.
      59d68b9d
  27. 06 May, 2016 2 commits
  28. 22 Apr, 2016 1 commit
  29. 31 Jan, 2016 1 commit
  30. 30 Jan, 2016 1 commit
  31. 25 Jan, 2016 2 commits
    • Boudewijn Rempt's avatar
      Move kritaimage to libs · b46898a0
      Boudewijn Rempt authored
      This shows up a bunch of other problems with alien includes. Some
      tests have been disabled (marked "kisdoc") because they needed
      kritaui.
      b46898a0
    • Boudewijn Rempt's avatar
      Move libcolor/libbrush/libpsd to libs · 39e45bae
      Boudewijn Rempt authored
      This basically showed that we had entangled ourselves majorly,
      kritaimage has includes from kritaui, which it exported to kritapsd
      and so on.
      39e45bae
  32. 10 Jan, 2016 1 commit
  33. 09 Jan, 2016 1 commit