Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Tusooa Zhu
Krita
Commits
c5968b58
Commit
c5968b58
authored
Mar 19, 2007
by
Thomas Zander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various fixes for painting / updating nested shapes
svn path=/trunk/koffice/; revision=644220
parent
4b2845b0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
4 deletions
+28
-4
libs/flake/KoShape.cpp
libs/flake/KoShape.cpp
+16
-1
libs/flake/KoShapeContainer.cpp
libs/flake/KoShapeContainer.cpp
+2
-1
libs/flake/KoShapeManager.cpp
libs/flake/KoShapeManager.cpp
+10
-2
No files found.
libs/flake/KoShape.cpp
View file @
c5968b58
...
...
@@ -346,7 +346,22 @@ QMatrix KoShape::transformationMatrix(const KoViewConverter *converter) const {
bool
KoShape
::
compareShapeZIndex
(
KoShape
*
s1
,
KoShape
*
s2
)
{
return
s1
->
zIndex
()
<
s2
->
zIndex
();
int
diff
=
s1
->
zIndex
()
-
s2
->
zIndex
();
if
(
diff
==
0
)
{
KoShape
*
s
=
s1
->
parent
();
while
(
s
)
{
if
(
s
==
s2
)
// s1 is a child of s2
return
false
;
// children are always on top of their parents.
s
=
s
->
parent
();
}
s
=
s2
->
parent
();
while
(
s
)
{
if
(
s
==
s1
)
// s2 is a child of s1
return
true
;
s
=
s
->
parent
();
}
}
return
diff
<
0
;
}
void
KoShape
::
setParent
(
KoShapeContainer
*
parent
)
{
...
...
libs/flake/KoShapeContainer.cpp
View file @
c5968b58
...
...
@@ -205,7 +205,8 @@ void KoShapeContainer::paint(QPainter &painter, const KoViewConverter &converter
void
KoShapeContainer
::
shapeChanged
(
ChangeType
type
)
{
if
(
d
->
children
==
0
)
return
;
if
(
!
(
type
==
RotationChanged
||
type
==
ScaleChanged
||
type
==
ShearChanged
||
type
==
SizeChanged
))
if
(
!
(
type
==
RotationChanged
||
type
==
ScaleChanged
||
type
==
ShearChanged
||
type
==
SizeChanged
||
type
==
PositionChanged
))
return
;
d
->
children
->
containerChanged
(
this
);
foreach
(
KoShape
*
shape
,
d
->
children
->
iterator
())
...
...
libs/flake/KoShapeManager.cpp
View file @
c5968b58
...
...
@@ -325,6 +325,12 @@ void KoShapeManager::notifyShapeChanged( KoShape * shape )
return
;
d
->
aggregate4update
.
insert
(
shape
);
d
->
shapeIndexesBeforeUpdate
.
insert
(
shape
,
shape
->
zIndex
());
KoShapeContainer
*
container
=
dynamic_cast
<
KoShapeContainer
*>
(
shape
);
if
(
container
)
{
foreach
(
KoShape
*
child
,
container
->
iterator
())
d
->
aggregate4update
.
insert
(
child
);
}
}
void
KoShapeManager
::
updateTree
()
...
...
@@ -354,8 +360,10 @@ void KoShapeManager::updateTree()
QList
<
KoShape
*>
shapesWithCollisionDetection
;
};
DetectCollision
detector
;
foreach
(
KoShape
*
shape
,
d
->
aggregate4update
)
detector
.
detect
(
d
->
tree
,
shape
,
d
->
shapeIndexesBeforeUpdate
[
shape
]);
foreach
(
KoShape
*
shape
,
d
->
aggregate4update
)
{
if
(
d
->
shapeIndexesBeforeUpdate
.
contains
(
shape
))
detector
.
detect
(
d
->
tree
,
shape
,
d
->
shapeIndexesBeforeUpdate
[
shape
]);
}
foreach
(
KoShape
*
shape
,
d
->
aggregate4update
)
{
...
...
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