Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
lifo
Nicolas Ollinger
OpenBoard
Commits
552df687
Commit
552df687
authored
Apr 22, 2014
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed stroke transformation
parent
5c89e8a7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
UBGraphicsStrokesGroup.cpp
src/domain/UBGraphicsStrokesGroup.cpp
+18
-3
No files found.
src/domain/UBGraphicsStrokesGroup.cpp
View file @
552df687
...
...
@@ -59,6 +59,7 @@ void UBGraphicsStrokesGroup::setUuid(const QUuid &pUuid)
UBItem
::
setUuid
(
pUuid
);
setData
(
UBGraphicsItemData
::
ItemUuid
,
QVariant
(
pUuid
));
//store item uuid inside the QGraphicsItem to fast operations with Items on the scene
}
void
UBGraphicsStrokesGroup
::
setColor
(
const
QColor
&
color
,
colorType
pColorType
)
{
//TODO Implement common mechanism of managing groups, drop UBGraphicsStroke if it's obsolete
...
...
@@ -140,10 +141,16 @@ void UBGraphicsStrokesGroup::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
UBItem
*
UBGraphicsStrokesGroup
::
deepCopy
()
const
{
QTransform
groupTransform
=
transform
();
qDebug
()
<<
"Initial original transform "
<<
groupTransform
;
UBGraphicsStrokesGroup
*
copy
=
new
UBGraphicsStrokesGroup
();
copyItemParameters
(
copy
);
copy
->
resetTransform
();
qDebug
()
<<
"Initial copy transform "
<<
copy
->
transform
();
QTransform
groupTransform
=
transform
();
const_cast
<
UBGraphicsStrokesGroup
*>
(
this
)
->
resetTransform
();
QList
<
QGraphicsItem
*>
chl
=
childItems
();
...
...
@@ -159,7 +166,6 @@ UBItem* UBGraphicsStrokesGroup::deepCopy() const
if
(
polygonCopy
)
{
QGraphicsItem
*
pItem
=
dynamic_cast
<
QGraphicsItem
*>
(
polygonCopy
);
polygonCopy
->
setTransform
(
groupTransform
);
copy
->
addToGroup
(
pItem
);
polygonCopy
->
setStrokesGroup
(
copy
);
polygonCopy
->
setStroke
(
newStroke
);
...
...
@@ -167,7 +173,16 @@ UBItem* UBGraphicsStrokesGroup::deepCopy() const
}
}
const_cast
<
UBGraphicsStrokesGroup
*>
(
this
)
->
setTransform
(
groupTransform
);
copy
->
setTransform
(
groupTransform
);
for
(
int
i
=
0
;
i
<
childItems
().
count
();
i
+=
1
){
Q_ASSERT
(
childItems
().
at
(
i
)
->
transform
().
m11
()
==
copy
->
childItems
().
at
(
i
)
->
transform
().
m11
());
Q_ASSERT
(
childItems
().
at
(
i
)
->
transform
().
m12
()
==
copy
->
childItems
().
at
(
i
)
->
transform
().
m12
());
Q_ASSERT
(
childItems
().
at
(
i
)
->
transform
().
m21
()
==
copy
->
childItems
().
at
(
i
)
->
transform
().
m21
());
Q_ASSERT
(
childItems
().
at
(
i
)
->
transform
().
m22
()
==
copy
->
childItems
().
at
(
i
)
->
transform
().
m22
());
Q_ASSERT
(
childItems
().
at
(
i
)
->
transform
().
m31
()
==
copy
->
childItems
().
at
(
i
)
->
transform
().
m31
());
Q_ASSERT
(
childItems
().
at
(
i
)
->
transform
().
m32
()
==
copy
->
childItems
().
at
(
i
)
->
transform
().
m32
());
}
return
copy
;
}
...
...
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