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
87ad5885
Commit
87ad5885
authored
Jun 21, 2013
by
Ilia Ryabokon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ZLayerController addItem() bug
parent
f47733ee
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
3 deletions
+30
-3
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+19
-0
UBGraphicsScene.h
src/domain/UBGraphicsScene.h
+2
-0
UBItem.cpp
src/domain/UBItem.cpp
+1
-0
UBSelectionFrame.cpp
src/domain/UBSelectionFrame.cpp
+8
-3
No files found.
src/domain/UBGraphicsScene.cpp
View file @
87ad5885
...
...
@@ -276,6 +276,18 @@ void UBZLayerController::setLayerType(QGraphicsItem *pItem, itemLayerType::Enum
pItem
->
setData
(
UBGraphicsItemData
::
itemLayerType
,
QVariant
(
pNewType
));
}
void
UBZLayerController
::
shiftStoredZValue
(
QGraphicsItem
*
item
,
qreal
zValue
)
{
itemLayerType
::
Enum
type
=
typeForData
(
item
);
if
(
validLayerType
(
type
))
{
ItemLayerTypeData
typeData
=
scopeMap
.
value
(
type
);
if
(
typeData
.
curValue
<
zValue
)
{
scopeMap
[
type
].
curValue
=
zValue
;
}
}
}
UBGraphicsScene
::
UBGraphicsScene
(
UBDocumentProxy
*
parent
,
bool
enableUndoRedoStack
)
:
UBCoreGraphicsScene
(
parent
)
,
mEraser
(
0
)
...
...
@@ -1051,6 +1063,11 @@ UBBoardView *UBGraphicsScene::controlView()
return
result
;
}
void
UBGraphicsScene
::
notifyZChanged
(
QGraphicsItem
*
item
,
qreal
zValue
)
{
mZLayerController
->
shiftStoredZValue
(
item
,
zValue
);
}
void
UBGraphicsScene
::
updateSelectionFrame
()
{
qDebug
()
<<
"selected item count"
<<
selectedItems
().
count
();
...
...
@@ -1647,6 +1664,8 @@ void UBGraphicsScene::addItem(QGraphicsItem* item)
if
(
item
->
zValue
()
==
DEFAULT_Z_VALUE
||
item
->
zValue
()
==
UBZLayerController
::
errorNum
()){
qreal
zvalue
=
mZLayerController
->
generateZLevel
(
item
);
UBGraphicsItem
::
assignZValue
(
item
,
zvalue
);
}
else
{
notifyZChanged
(
item
,
item
->
zValue
());
}
if
(
!
mTools
.
contains
(
item
))
...
...
src/domain/UBGraphicsScene.h
View file @
87ad5885
...
...
@@ -96,6 +96,7 @@ public:
qreal
changeZLevelTo
(
QGraphicsItem
*
item
,
moveDestination
dest
);
itemLayerType
::
Enum
typeForData
(
QGraphicsItem
*
item
)
const
;
void
setLayerType
(
QGraphicsItem
*
pItem
,
itemLayerType
::
Enum
pNewType
);
void
shiftStoredZValue
(
QGraphicsItem
*
item
,
qreal
zValue
);
private
:
ScopeMap
scopeMap
;
...
...
@@ -311,6 +312,7 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
UBGraphicsPolygonItem
*
polygonToPolygonItem
(
const
QPolygonF
pPolygon
);
void
clearSelectionFrame
();
UBBoardView
*
controlView
();
void
notifyZChanged
(
QGraphicsItem
*
item
,
qreal
zValue
);
public
slots
:
...
...
src/domain/UBItem.cpp
View file @
87ad5885
...
...
@@ -32,6 +32,7 @@
#include "domain/UBGraphicsStrokesGroup.h"
#include "domain/UBGraphicsGroupContainerItem.h"
#include "domain/UBGraphicsWidgetItem.h"
#include "domain/UBGraphicsScene.h"
#include "tools/UBGraphicsCurtainItem.h"
#include "domain/UBGraphicsItemDelegate.h"
...
...
src/domain/UBSelectionFrame.cpp
View file @
87ad5885
...
...
@@ -191,7 +191,7 @@ void UBSelectionFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
item
->
update
();
item
->
setTransform
(
ownTransform
,
false
);
int
resultAngle
=
(
int
)
mRotationAngle
%
360
;
//
int resultAngle = (int)mRotationAngle % 360;
// setCursorFromAngle(QString::number(resultAngle));
qDebug
()
<<
"curAngle"
<<
mRotationAngle
;
...
...
@@ -284,9 +284,14 @@ void UBSelectionFrame::increaseZlevelDown()
void
UBSelectionFrame
::
increaseZlevelBottom
()
{
foreach
(
QGraphicsItem
*
item
,
sortedByZ
(
scene
()
->
selectedItems
()))
{
ubscene
()
->
changeZLevelTo
(
item
,
UBZLayerController
::
bottom
);
QListIterator
<
QGraphicsItem
*>
iter
(
sortedByZ
(
scene
()
->
selectedItems
()));
iter
.
toBack
();
while
(
iter
.
hasPrevious
())
{
ubscene
()
->
changeZLevelTo
(
iter
.
previous
(),
UBZLayerController
::
bottom
);
}
// foreach (QGraphicsItem *item, sortedByZ(scene()->selectedItems())) {
// ubscene()->changeZLevelTo(item, UBZLayerController::bottom);
// }
}
void
UBSelectionFrame
::
translateItem
(
QGraphicsItem
*/
*
item
*/
,
const
QPointF
&
/*translatePoint*/
)
...
...
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