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
4b7939b6
Commit
4b7939b6
authored
Aug 31, 2012
by
Aleksei Kanash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Grouped items doesn't manages by mFastAccessItems now.
parent
0b108d46
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
4 deletions
+22
-4
UBBoardController.cpp
src/board/UBBoardController.cpp
+3
-2
UBGraphicsGroupContainerItem.cpp
src/domain/UBGraphicsGroupContainerItem.cpp
+6
-0
UBGraphicsPolygonItem.cpp
src/domain/UBGraphicsPolygonItem.cpp
+2
-2
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+11
-0
No files found.
src/board/UBBoardController.cpp
View file @
4b7939b6
...
...
@@ -1482,11 +1482,12 @@ void UBBoardController::ClearUndoStack()
UBGraphicsItemUndoCommand
*
cmd
=
(
UBGraphicsItemUndoCommand
*
)
UBApplication
::
undoStack
->
command
(
i
);
// go through all added and removed objects, for create list of unique objects
// grouped items will be deleted by groups, so we don't need do delete that items.
QSetIterator
<
QGraphicsItem
*>
itAdded
(
cmd
->
GetAddedList
());
while
(
itAdded
.
hasNext
())
{
QGraphicsItem
*
item
=
itAdded
.
next
();
if
(
!
uniqueItems
.
contains
(
item
)
)
if
(
!
uniqueItems
.
contains
(
item
)
&&
!
(
item
->
parentItem
()
&&
UBGraphicsGroupContainerItem
::
Type
==
item
->
parentItem
()
->
type
())
)
uniqueItems
.
insert
(
item
);
}
...
...
@@ -1494,7 +1495,7 @@ void UBBoardController::ClearUndoStack()
while
(
itRemoved
.
hasNext
())
{
QGraphicsItem
*
item
=
itRemoved
.
next
();
if
(
!
uniqueItems
.
contains
(
item
)
)
if
(
!
uniqueItems
.
contains
(
item
)
&&
(
item
->
parentItem
()
&&
UBGraphicsGroupContainerItem
::
Type
!=
item
->
parentItem
()
->
type
())
)
uniqueItems
.
insert
(
item
);
}
}
...
...
src/domain/UBGraphicsGroupContainerItem.cpp
View file @
4b7939b6
...
...
@@ -324,6 +324,12 @@ void UBGraphicsGroupContainerItem::pRemoveFromGroup(QGraphicsItem *item)
item
->
setParentItem
(
newParent
);
item
->
setPos
(
oldPos
);
UBGraphicsScene
*
Scene
=
dynamic_cast
<
UBGraphicsScene
*>
(
item
->
scene
());
if
(
Scene
)
{
Scene
->
addItem
(
item
);
}
// removing position from translation component of the new transform
if
(
!
item
->
pos
().
isNull
())
itemTransform
*=
QTransform
::
fromTranslate
(
-
item
->
x
(),
-
item
->
y
());
...
...
src/domain/UBGraphicsPolygonItem.cpp
View file @
4b7939b6
...
...
@@ -67,8 +67,8 @@ void UBGraphicsPolygonItem::clearStroke()
if
(
mStroke
!=
NULL
)
{
mStroke
->
remove
(
this
);
if
(
mStroke
->
polygons
().
empty
())
delete
mStroke
;
//
if (mStroke->polygons().empty())
//
delete mStroke;
mStroke
=
NULL
;
}
}
...
...
src/domain/UBGraphicsScene.cpp
View file @
4b7939b6
...
...
@@ -1374,9 +1374,11 @@ UBGraphicsGroupContainerItem *UBGraphicsScene::createGroup(QList<QGraphicsItem *
}
foreach
(
QGraphicsItem
*
chItem
,
childItems
)
{
groupItem
->
addToGroup
(
chItem
);
mFastAccessItems
.
removeAll
(
item
);
}
}
else
{
groupItem
->
addToGroup
(
item
);
mFastAccessItems
.
removeAll
(
item
);
}
}
...
...
@@ -1396,6 +1398,15 @@ UBGraphicsGroupContainerItem *UBGraphicsScene::createGroup(QList<QGraphicsItem *
void
UBGraphicsScene
::
addGroup
(
UBGraphicsGroupContainerItem
*
groupItem
)
{
addItem
(
groupItem
);
for
(
int
i
=
0
;
i
<
groupItem
->
childItems
().
count
();
i
++
)
{
QGraphicsItem
*
it
=
qgraphicsitem_cast
<
QGraphicsItem
*>
(
groupItem
->
childItems
().
at
(
i
));
if
(
it
)
{
mFastAccessItems
.
removeAll
(
it
);
}
}
groupItem
->
setVisible
(
true
);
groupItem
->
setFocus
();
...
...
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