Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Krita
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tusooa Zhu
Krita
Commits
e4f74f1c
Commit
e4f74f1c
authored
Aug 06, 2019
by
Tusooa Zhu
➡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port KisToolShape to the new-style stroke
parent
a3912028
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
libs/ui/tool/kis_tool_shape.cc
libs/ui/tool/kis_tool_shape.cc
+10
-11
No files found.
libs/ui/tool/kis_tool_shape.cc
View file @
e4f74f1c
...
...
@@ -52,6 +52,8 @@
#include "kis_selection_mask.h"
#include "kis_shape_selection.h"
#include "kis_processing_applicator.h"
#include <../../opt/krita/src/libs/flake/KoCanvasStrokeHelperBase.h>
#include <../../opt/krita/src/libs/flake/KoCanvasStrokeHelperBase.h>
KisToolShape
::
KisToolShape
(
KoCanvasBase
*
canvas
,
const
QCursor
&
cursor
)
...
...
@@ -212,19 +214,16 @@ void KisToolShape::addShape(KoShape* shape)
}
}
KUndo2Command
*
parentCommand
=
new
KUndo2Command
();
KoSelection
*
selection
=
canvas
()
->
selectedShapesProxy
()
->
selection
();
const
QList
<
KoShape
*>
oldSelectedShapes
=
selection
->
selectedShapes
();
// reset selection on the newly added shape :)
// TODO: think about moving this into controller->addShape?
new
KoKeepShapesSelectedCommand
(
oldSelectedShapes
,
{
shape
},
canvas
()
->
selectedShapesProxy
(),
false
,
parentCommand
);
KUndo2Command
*
cmd
=
canvas
()
->
shapeController
()
->
addShape
(
shape
,
0
,
parentCommand
);
parentCommand
->
setText
(
cmd
->
text
());
new
KoKeepShapesSelectedCommand
(
oldSelectedShapes
,
{
shape
},
canvas
()
->
selectedShapesProxy
(),
true
,
parentCommand
);
KisProcessingApplicator
::
runSingleCommandStroke
(
image
(),
cmd
);
canvas
()
->
strokeHelper
()
->
run
(
kundo2_i18n
(
"Create shape (new)"
),
[
selection
,
shape
,
this
]()
{
canvas
()
->
shapeController
()
->
addShape
(
shape
,
0
);
selection
->
deselectAll
();
selection
->
select
(
shape
);
return
true
;
}
);
}
void
KisToolShape
::
addPathShape
(
KoPathShape
*
pathShape
,
const
KUndo2MagicString
&
name
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment