Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Krita
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tusooa Zhu
Krita
Commits
e4eec95e
Commit
e4eec95e
authored
Aug 21, 2015
by
Dmitry Kazakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make a transform tool work with Pass Through group layers
BUG:351548
parent
cc49bd2d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
1 deletion
+44
-1
krita/image/kis_projection_leaf.cpp
krita/image/kis_projection_leaf.cpp
+32
-0
krita/image/kis_projection_leaf.h
krita/image/kis_projection_leaf.h
+9
-0
krita/plugins/tools/tool_transform2/strokes/transform_stroke_strategy.cpp
...ols/tool_transform2/strokes/transform_stroke_strategy.cpp
+3
-1
No files found.
krita/image/kis_projection_leaf.cpp
View file @
e4eec95e
...
@@ -27,6 +27,9 @@
...
@@ -27,6 +27,9 @@
#include "krita_utils.h"
#include "krita_utils.h"
#include "kis_refresh_subtree_walker.h"
#include "kis_async_merger.h"
struct
KisProjectionLeaf
::
Private
struct
KisProjectionLeaf
::
Private
{
{
...
@@ -46,6 +49,13 @@ struct KisProjectionLeaf::Private
...
@@ -46,6 +49,13 @@ struct KisProjectionLeaf::Private
bool
checkThisPassThrough
()
{
bool
checkThisPassThrough
()
{
return
checkPassThrough
(
node
);
return
checkPassThrough
(
node
);
}
}
void
temporarySetPassThrough
(
bool
value
)
{
KisGroupLayer
*
group
=
qobject_cast
<
KisGroupLayer
*>
(
node
);
if
(
!
group
)
return
;
group
->
setPassThroughMode
(
value
);
}
};
};
KisProjectionLeaf
::
KisProjectionLeaf
(
KisNode
*
node
)
KisProjectionLeaf
::
KisProjectionLeaf
(
KisNode
*
node
)
...
@@ -247,3 +257,25 @@ bool KisProjectionLeaf::isDroppedMask() const
...
@@ -247,3 +257,25 @@ bool KisProjectionLeaf::isDroppedMask() const
return
qobject_cast
<
KisMask
*>
(
m_d
->
node
)
&&
return
qobject_cast
<
KisMask
*>
(
m_d
->
node
)
&&
m_d
->
checkParentPassThrough
();
m_d
->
checkParentPassThrough
();
}
}
/**
* This method is rather slow and dangerous. It should be executes in
* exclusive environment only.
*/
void
KisProjectionLeaf
::
explicitlyRegeneratePassThroughProjection
()
{
if
(
!
m_d
->
checkThisPassThrough
())
return
;
m_d
->
temporarySetPassThrough
(
false
);
const
QRect
updateRect
=
projection
()
->
defaultBounds
()
->
bounds
();
KisRefreshSubtreeWalker
walker
(
updateRect
);
walker
.
collectRects
(
m_d
->
node
,
updateRect
);
KisAsyncMerger
merger
;
merger
.
startMerge
(
walker
);
m_d
->
temporarySetPassThrough
(
true
);
}
krita/image/kis_projection_leaf.h
View file @
e4eec95e
...
@@ -62,6 +62,15 @@ public:
...
@@ -62,6 +62,15 @@ public:
bool
isDroppedMask
()
const
;
bool
isDroppedMask
()
const
;
/**
* Regenerate projection of the current group layer iff it is
* pass-through mode.
*
* WARNING: must be called either under the image lock held
* or in the context of an exclusive stroke job.
*/
void
explicitlyRegeneratePassThroughProjection
();
private:
private:
struct
Private
;
struct
Private
;
const
QScopedPointer
<
Private
>
m_d
;
const
QScopedPointer
<
Private
>
m_d
;
...
...
krita/plugins/tools/tool_transform2/strokes/transform_stroke_strategy.cpp
View file @
e4eec95e
...
@@ -33,6 +33,8 @@
...
@@ -33,6 +33,8 @@
#include "kis_transform_mask_adapter.h"
#include "kis_transform_mask_adapter.h"
#include "kis_transform_utils.h"
#include "kis_transform_utils.h"
#include "kis_projection_leaf.h"
class
ModifyTransformMaskCommand
:
public
KUndo2Command
{
class
ModifyTransformMaskCommand
:
public
KUndo2Command
{
public:
public:
...
@@ -102,8 +104,8 @@ TransformStrokeStrategy::TransformStrokeStrategy(KisNodeSP rootNode,
...
@@ -102,8 +104,8 @@ TransformStrokeStrategy::TransformStrokeStrategy(KisNodeSP rootNode,
* taken into account.
* taken into account.
*/
*/
m_selection
=
0
;
m_selection
=
0
;
}
else
{
}
else
{
rootNode
->
projectionLeaf
()
->
explicitlyRegeneratePassThroughProjection
();
device
=
rootNode
->
projection
();
device
=
rootNode
->
projection
();
}
}
...
...
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