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
b84ccd7f
Commit
b84ccd7f
authored
Jul 31, 2006
by
Thomas Zander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sigh. Fix more merge errors that caused compile to fail. :(
svn path=/trunk/koffice/; revision=568304
parent
109a0f1c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
121 deletions
+0
-121
libs/flake/KoCommand.cpp
libs/flake/KoCommand.cpp
+0
-61
libs/flake/KoShapeContainer.cpp
libs/flake/KoShapeContainer.cpp
+0
-31
libs/flake/KoShapeContainer.h
libs/flake/KoShapeContainer.h
+0
-3
libs/flake/KoShapeGroup.cpp
libs/flake/KoShapeGroup.cpp
+0
-24
libs/flake/KoShapeGroup.h
libs/flake/KoShapeGroup.h
+0
-2
No files found.
libs/flake/KoCommand.cpp
View file @
b84ccd7f
...
...
@@ -184,10 +184,6 @@ KoGroupShapesCommand::KoGroupShapesCommand() {
}
void
KoGroupShapesCommand
::
execute
()
{
v
v
v
v
v
v
v
QList
<
QPointF
>
positions
;
QRectF
bound
=
m_container
->
boundingRect
();
*************
QList
<
QPointF
>
positions
;
bool
boundingRectInitialized
=
true
;
QRectF
bound
;
...
...
@@ -195,12 +191,7 @@ v v v v v v v
bound
=
m_container
->
boundingRect
();
else
boundingRectInitialized
=
false
;
^
^
^
^
^
^
^
foreach
(
KoShape
*
shape
,
m_shapes
)
{
v
v
v
v
v
v
v
positions
.
append
(
shape
->
absolutePosition
());
bound
=
bound
.
unite
(
shape
->
boundingRect
());
*************
positions
.
append
(
shape
->
absolutePosition
());
if
(
boundingRectInitialized
)
bound
=
bound
.
unite
(
shape
->
boundingRect
());
...
...
@@ -208,19 +199,8 @@ v v v v v v v
bound
=
shape
->
boundingRect
();
boundingRectInitialized
=
true
;
}
^
^
^
^
^
^
^
m_container
->
addChild
(
shape
);
v
v
v
v
v
v
v
^
^
^
^
^
^
^
}
v
v
v
v
v
v
v
for
(
int
i
=
0
;
i
<
m_shapes
.
count
();
i
++
)
{
m_shapes
[
i
]
->
setAbsolutePosition
(
positions
[
i
]
);
}
m_container
->
setPosition
(
bound
.
topLeft
()
);
m_container
->
resize
(
bound
.
size
()
);
*************
m_container
->
setPosition
(
bound
.
topLeft
()
);
m_container
->
resize
(
bound
.
size
()
);
for
(
int
i
=
0
;
i
<
m_shapes
.
count
();
i
++
)
{
...
...
@@ -228,11 +208,9 @@ v v v v v v v
}
kDebug
()
<<
"after group: "
<<
m_container
->
position
().
x
()
<<
", "
<<
m_container
->
position
().
y
()
<<
endl
;
^
^
^
^
^
^
^
}
void
KoGroupShapesCommand
::
unexecute
()
{
v
v
v
v
v
v
v
QList
<
QPointF
>
positions
;
foreach
(
KoShape
*
shape
,
m_shapes
)
positions
.
append
(
shape
->
absolutePosition
());
...
...
@@ -240,7 +218,6 @@ v v v v v v v
for
(
int
i
=
0
;
i
<
m_shapes
.
count
();
i
++
)
{
m_container
->
removeChild
(
m_shapes
[
i
]);
m_shapes
[
i
]
->
setAbsolutePosition
(
positions
[
i
]
);
^
^
^
^
^
^
^
}
}
...
...
@@ -383,9 +360,7 @@ KoShapeAlignCommand::KoShapeAlignCommand( const KoSelectionSet &shapes, Align al
QList
<
QPointF
>
previousPositions
;
QList
<
QPointF
>
newPositions
;
QPointF
position
;
v
v
v
v
v
v
v
QPointF
delta
;
^
^
^
^
^
^
^
QRectF
bRect
;
foreach
(
KoShape
*
shape
,
shapes
)
{
if
(
dynamic_cast
<
KoShapeGroup
*>
(
shape
))
...
...
@@ -400,43 +375,27 @@ else
switch
(
align
)
{
case
ALIGN_HORIZONTAL_LEFT
:
v
v
v
v
v
v
v
delta
=
QPointF
(
boundingRect
.
left
(),
bRect
.
y
())
-
bRect
.
topLeft
();
^
^
^
^
^
^
^
break
;
case
ALIGN_HORIZONTAL_CENTER
:
v
v
v
v
v
v
v
delta
=
QPointF
(
boundingRect
.
center
().
x
()
-
bRect
.
width
()
/
2
,
bRect
.
y
())
-
bRect
.
topLeft
();
^
^
^
^
^
^
^
break
;
case
ALIGN_HORIZONTAL_RIGHT
:
v
v
v
v
v
v
v
delta
=
QPointF
(
boundingRect
.
right
()
-
bRect
.
width
(),
bRect
.
y
())
-
bRect
.
topLeft
();
^
^
^
^
^
^
^
break
;
case
ALIGN_VERTICAL_TOP
:
v
v
v
v
v
v
v
delta
=
QPointF
(
bRect
.
x
(),
boundingRect
.
top
())
-
bRect
.
topLeft
();
^
^
^
^
^
^
^
break
;
case
ALIGN_VERTICAL_CENTER
:
v
v
v
v
v
v
v
delta
=
QPointF
(
bRect
.
x
(),
boundingRect
.
center
().
y
()
-
bRect
.
height
()
/
2
)
-
bRect
.
topLeft
();
^
^
^
^
^
^
^
break
;
case
ALIGN_VERTICAL_BOTTOM
:
v
v
v
v
v
v
v
delta
=
QPointF
(
bRect
.
x
(),
boundingRect
.
bottom
()
-
bRect
.
height
())
-
bRect
.
topLeft
();
^
^
^
^
^
^
^
break
;
};
v
v
v
v
v
v
v
newPositions
<<
position
+
delta
;
*************
newPositions
<<
position
+
delta
;
kDebug
()
<<
"-> moving "
<<
position
.
x
()
<<
","
<<
position
.
y
()
<<
" to "
<<
(
position
+
delta
).
x
()
<<
", "
<<
(
position
+
delta
).
y
()
<<
endl
;
^
^
^
^
^
^
^
}
m_command
=
new
KoShapeMoveCommand
(
shapes
,
previousPositions
,
newPositions
);
}
...
...
@@ -504,9 +463,7 @@ KoShapeDistributeCommand::KoShapeDistributeCommand( const KoSelectionSet &shapes
QList
<
QPointF
>
previousPositions
;
QList
<
QPointF
>
newPositions
;
QPointF
position
;
v
v
v
v
v
v
v
QPointF
delta
;
^
^
^
^
^
^
^
QMapIterator
<
double
,
KoShape
*>
it
(
sortedPos
);
while
(
it
.
hasNext
())
{
...
...
@@ -517,51 +474,33 @@ v v v v v v v
bRect
=
it
.
value
()
->
boundingRect
();
switch
(
m_distribute
)
{
case
DISTRIBUTE_HORIZONTAL_CENTER
:
v
v
v
v
v
v
v
delta
=
QPointF
(
boundingRect
.
x
()
+
first
->
boundingRect
().
width
()
/
2
+
pos
-
bRect
.
width
()
/
2
,
bRect
.
y
()
)
-
bRect
.
topLeft
();
^
^
^
^
^
^
^
break
;
case
DISTRIBUTE_HORIZONTAL_GAP
:
v
v
v
v
v
v
v
delta
=
QPointF
(
boundingRect
.
left
()
+
pos
,
bRect
.
y
()
)
-
bRect
.
topLeft
();
^
^
^
^
^
^
^
pos
+=
bRect
.
width
();
break
;
case
DISTRIBUTE_HORIZONTAL_LEFT
:
v
v
v
v
v
v
v
delta
=
QPointF
(
boundingRect
.
left
()
+
pos
,
bRect
.
y
()
)
-
bRect
.
topLeft
();
^
^
^
^
^
^
^
break
;
case
DISTRIBUTE_HORIZONTAL_RIGHT
:
v
v
v
v
v
v
v
delta
=
QPointF
(
boundingRect
.
left
()
+
first
->
boundingRect
().
width
()
+
pos
-
bRect
.
width
(),
bRect
.
y
()
)
-
bRect
.
topLeft
();
^
^
^
^
^
^
^
break
;
case
DISTRIBUTE_VERTICAL_CENTER
:
v
v
v
v
v
v
v
delta
=
QPointF
(
bRect
.
x
(),
boundingRect
.
y
()
+
first
->
boundingRect
().
height
()
/
2
+
pos
-
bRect
.
height
()
/
2
)
-
bRect
.
topLeft
();
^
^
^
^
^
^
^
break
;
case
DISTRIBUTE_VERTICAL_GAP
:
v
v
v
v
v
v
v
delta
=
QPointF
(
bRect
.
x
(),
boundingRect
.
top
()
+
pos
)
-
bRect
.
topLeft
();
^
^
^
^
^
^
^
pos
+=
bRect
.
height
();
break
;
case
DISTRIBUTE_VERTICAL_BOTTOM
:
v
v
v
v
v
v
v
delta
=
QPointF
(
bRect
.
x
(),
boundingRect
.
top
()
+
first
->
boundingRect
().
height
()
+
pos
-
bRect
.
height
()
)
-
bRect
.
topLeft
();
^
^
^
^
^
^
^
break
;
case
DISTRIBUTE_VERTICAL_TOP
:
v
v
v
v
v
v
v
delta
=
QPointF
(
bRect
.
x
(),
boundingRect
.
top
()
+
pos
)
-
bRect
.
topLeft
();
^
^
^
^
^
^
^
break
;
};
v
v
v
v
v
v
v
newPositions
<<
position
+
delta
;
^
^
^
^
^
^
^
pos
+=
step
;
}
m_command
=
new
KoShapeMoveCommand
(
sortedPos
.
values
(),
previousPositions
,
newPositions
);
...
...
libs/flake/KoShapeContainer.cpp
View file @
b84ccd7f
...
...
@@ -35,30 +35,22 @@ KoShapeContainer::~KoShapeContainer() {
delete
m_children
;
}
v
v
v
v
v
v
v
void
KoShapeContainer
::
addChild
(
KoShape
*
shape
)
{
Q_ASSERT
(
shape
);
^
^
^
^
^
^
^
if
(
m_children
==
0
)
m_children
=
new
ChildrenData
();
v
v
v
v
v
v
v
m_children
->
add
(
shape
);
shape
->
setParent
(
this
);
childCountChanged
();
^
^
^
^
^
^
^
}
v
v
v
v
v
v
v
void
KoShapeContainer
::
removeChild
(
KoShape
*
shape
)
{
Q_ASSERT
(
shape
);
^
^
^
^
^
^
^
if
(
m_children
==
0
)
return
;
v
v
v
v
v
v
v
m_children
->
remove
(
shape
);
shape
->
setParent
(
0
);
childCountChanged
();
^
^
^
^
^
^
^
}
int
KoShapeContainer
::
childCount
()
const
{
...
...
@@ -94,28 +86,6 @@ void KoShapeContainer::paint(QPainter &painter, const KoViewConverter &converter
// QPolygon clip = (myMatrix * shapeMatrix.inverted()).mapToPolygon(clipRect.toRect());
// painter.setClipRegion(QRegion(clip));
v
v
v
v
v
v
v
if
(
!
childClipped
(
shape
)
)
continue
;
QRectF
clipRect
(
QPointF
(
0
,
0
),
size
());
clipRect
=
converter
.
documentToView
(
clipRect
);
QRectF
clipRect
(
QPointF
(
0
,
0
),
size
());
clipRect
=
converter
.
documentToView
(
clipRect
);
QPolygon
clip
=
myMatrix
.
mapToPolygon
(
clipRect
.
toRect
());
clip
.
translate
(
(
position
()
-
converter
.
documentToView
(
position
())).
toPoint
()
);
painter
.
setClipRegion
(
QRegion
(
clip
));
*************
if
(
!
childClipped
(
shape
)
)
continue
;
QRectF
clipRect
(
QPointF
(
0
,
0
),
size
());
clipRect
=
converter
.
documentToView
(
clipRect
);
QPolygon
clip
=
myMatrix
.
mapToPolygon
(
clipRect
.
toRect
());
clip
.
translate
(
(
position
()
-
converter
.
documentToView
(
position
())).
toPoint
()
);
painter
.
setClipRegion
(
QRegion
(
clip
));
*************
if
(
!
childClipped
(
shape
)
)
continue
;
QRectF
clipRect
(
QPointF
(
0
,
0
),
size
());
...
...
@@ -124,7 +94,6 @@ v v v v v v v
QPolygon
clip
=
myMatrix
.
mapToPolygon
(
clipRect
.
toRect
());
clip
.
translate
(
(
position
()
-
converter
.
documentToView
(
position
())).
toPoint
()
);
painter
.
setClipRegion
(
QRegion
(
clip
));
^
^
^
^
^
^
^
//kDebug() << "rect: " << position() << endl;
//kDebug() << "polygon: " << clip.boundingRect() << endl;
//painter.drawPolygon(clip);
...
...
libs/flake/KoShapeContainer.h
View file @
b84ccd7f
...
...
@@ -193,9 +193,6 @@ public:
protected:
virtual
void
childCountChanged
()
{
}
protected:
virtual
void
childCountChanged
()
{
}
private:
/**
*/
...
...
libs/flake/KoShapeGroup.cpp
View file @
b84ccd7f
...
...
@@ -66,33 +66,9 @@ bool KoShapeGroup::GroupMembers::childClipped(const KoShape *child) const {
Q_UNUSED
(
child
);
return
false
;
}
v
v
v
v
v
v
v
void
KoShapeGroup
::
childCountChanged
()
{
QRectF
br
=
boundingRect
();
setPosition
(
br
.
topLeft
()
);
resize
(
br
.
size
()
);
*************
void
KoShapeGroup
::
childCountChanged
()
{
QRectF
br
=
boundingRect
();
setPosition
(
br
.
topLeft
()
);
resize
(
br
.
size
()
);
}
QRectF
KoShapeGroup
::
boundingRect
()
const
{
bool
first
=
true
;
QRectF
boundingRect
;
foreach
(
KoShape
*
shape
,
iterator
())
{
if
(
first
)
{
boundingRect
=
shape
->
boundingRect
();
first
=
false
;
}
else
boundingRect
=
boundingRect
.
unite
(
shape
->
boundingRect
()
);
}
return
boundingRect
;
^
^
^
^
^
^
^
}
libs/flake/KoShapeGroup.h
View file @
b84ccd7f
...
...
@@ -64,10 +64,8 @@ private:
private:
// members
QList
<
KoShape
*>
m_groupMembers
;
};
v
v
v
v
v
v
v
void
childCountChanged
();
^
^
^
^
^
^
^
};
#endif
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