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
e943854c
Commit
e943854c
authored
Dec 14, 2011
by
Ivan Ilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Z-value is now working correct
parent
31ca9eca
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
23 deletions
+29
-23
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+2
-1
UBGraphicsDelegateFrame.cpp
src/domain/UBGraphicsDelegateFrame.cpp
+3
-0
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+2
-4
UBGraphicsItemTransformUndoCommand.cpp
src/domain/UBGraphicsItemTransformUndoCommand.cpp
+3
-3
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+19
-15
No files found.
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
e943854c
...
...
@@ -107,7 +107,8 @@ QMatrix UBSvgSubsetAdaptor::fromSvgTransform(const QString& transform)
static
bool
itemZIndexComp
(
const
QGraphicsItem
*
item1
,
const
QGraphicsItem
*
item2
)
{
return
item1
->
zValue
()
<
item2
->
zValue
();
// return item1->zValue() < item2->zValue();
return
item1
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
()
<
item2
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
();
}
...
...
src/domain/UBGraphicsDelegateFrame.cpp
View file @
e943854c
...
...
@@ -531,6 +531,9 @@ void UBGraphicsDelegateFrame::positionHandles()
{
setBrush
(
QBrush
(
UBSettings
::
paletteColor
));
}
//make frame interact like delegated item when selected. Maybe should be deleted if selection logic will change
setZValue
(
delegated
()
->
zValue
());
}
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
e943854c
...
...
@@ -93,8 +93,8 @@ void UBGraphicsItemDelegate::init()
foreach
(
DelegateButton
*
button
,
mButtons
)
{
button
->
hide
();
button
->
setZValue
(
UBGraphicsScene
::
toolLayerStart
+
2
);
//
UBGraphicsItem::assignZValue(button, UBGraphicsScene::toolLayerStart + 2);
//
button->setZValue(UBGraphicsScene::toolLayerStart + 2);
UBGraphicsItem
::
assignZValue
(
button
,
UBGraphicsScene
::
toolLayerStart
+
2
);
button
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
}
}
...
...
@@ -323,12 +323,10 @@ void UBGraphicsItemDelegate::lock(bool locked)
if
(
locked
)
{
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
QVariant
(
true
));
qDebug
()
<<
"item's data is called for locked"
<<
mDelegated
->
data
(
UBGraphicsItemData
::
ItemLocked
);
}
else
{
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
QVariant
(
false
));
qDebug
()
<<
"item's data is called for unlocked"
<<
mDelegated
->
data
(
UBGraphicsItemData
::
ItemLocked
);
}
mDelegated
->
update
();
...
...
src/domain/UBGraphicsItemTransformUndoCommand.cpp
View file @
e943854c
...
...
@@ -49,7 +49,7 @@ void UBGraphicsItemTransformUndoCommand::undo()
{
mItem
->
setPos
(
mPreviousPosition
);
mItem
->
setTransform
(
mPreviousTransform
);
//
mItem->setZValue(mPreviousZValue);
mItem
->
setZValue
(
mPreviousZValue
);
// UBGraphicsItem::assignZValue(mItem, mPreviousZValue);
UBResizableGraphicsItem
*
resizableItem
=
dynamic_cast
<
UBResizableGraphicsItem
*>
(
mItem
);
...
...
@@ -62,9 +62,9 @@ void UBGraphicsItemTransformUndoCommand::redo()
{
mItem
->
setPos
(
mCurrentPosition
);
mItem
->
setTransform
(
mCurrentTransform
);
//
mItem->setZValue(mCurrentZValue);
mItem
->
setZValue
(
mCurrentZValue
);
UBGraphicsItem
::
assignZValue
(
mItem
,
/*mCurrentZValue*/
mItem
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
());
//
UBGraphicsItem::assignZValue(mItem, /*mCurrentZValue*/mItem->data(UBGraphicsItemData::ItemOwnZValue).toReal());
UBResizableGraphicsItem
*
resizableItem
=
dynamic_cast
<
UBResizableGraphicsItem
*>
(
mItem
);
...
...
src/domain/UBGraphicsScene.cpp
View file @
e943854c
...
...
@@ -164,6 +164,7 @@ void UBGraphicsScene::selectionChangedProcessing()
QList
<
QGraphicsItem
*>
allItemsList
=
items
();
QtLogger
::
logger
()
<<
"=====all items searching...======"
<<
endl
;
qreal
maxZ
=
0.
;
for
(
int
i
=
0
;
i
<
allItemsList
.
size
();
i
++
)
{
QGraphicsItem
*
nextItem
=
allItemsList
.
at
(
i
);
...
...
@@ -173,27 +174,29 @@ void UBGraphicsScene::selectionChangedProcessing()
continue
;
//Temporary stub end (sankore 360)
// qreal zValue = nextItem->zValue();
// nextItem->setZValue(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal());
nextItem
->
setZValue
(
1
);
if
(
nextItem
->
zValue
()
>
maxZ
)
maxZ
=
nextItem
->
zValue
();
nextItem
->
setZValue
(
nextItem
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
());
// nextItem->setZValue(qreal(1));
QtLogger
::
logger
()
<<
"own Z "
<<
QString
::
number
(
nextItem
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
(),
'f'
)
<<
" next Z "
<<
QString
::
number
(
nextItem
->
zValue
(),
'f'
)
<<
endl
;
// qDebug() << QString(" %1 ").arg(i) << QString(" %1 ").arg(zValue);
}
QList
<
QGraphicsItem
*>
selItemsList
=
selectedItems
();
QtLogger
::
logger
()
<<
"=====selected items searching...======"
<<
endl
;
QGraphicsItem
*
nextItem
;
//
QGraphicsItem *nextItem;
for
(
int
i
=
0
;
i
<
selItemsList
.
size
();
i
++
)
{
nextItem
=
selItemsList
.
at
(
i
);
QGraphicsItem
*
nextItem
=
selItemsList
.
at
(
i
);
QtLogger
::
logger
()
<<
"own Z "
<<
QString
::
number
(
nextItem
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
(),
'f'
)
<<
" next Z "
<<
QString
::
number
(
nextItem
->
zValue
(),
'f'
)
<<
endl
;
// qreal zValue = nextItem->zValue();
nextItem
->
setZValue
(
2
);
nextItem
->
setZValue
(
maxZ
+
0.0001
);
// qDebug() << QString(" >>> %1 <<< ").arg(i) << QString(" >>> %1 <<< ").arg(zValue);
}
QtLogger
::
logger
()
<<
"
\n
selection processing finished"
<<
endl
;
QtLogger
::
logger
().
finish
();
}
// MARK: -
...
...
@@ -424,23 +427,23 @@ void UBGraphicsScene::drawEraser(const QPointF &pPoint, bool isFirstDraw)
if
(
isFirstDraw
)
{
qreal
maxZ
=
0.
;
QList
<
QGraphicsItem
*>
allItemsList
=
items
();
for
(
int
i
=
0
;
i
<
allItemsList
.
size
();
i
++
)
{
QGraphicsItem
*
nextItem
=
allItemsList
.
at
(
i
);
qreal
zValue
=
nextItem
->
zValue
();
nextItem
->
setZValue
(
qreal
(
1
));
qDebug
()
<<
QString
(
" %1 "
).
arg
(
i
)
<<
QString
(
" %1 "
).
arg
(
zValue
);
if
(
zValue
>
maxZ
)
maxZ
=
zValue
;
nextItem
->
setZValue
(
nextItem
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
());
}
mEraser
->
setZValue
(
2
);
mEraser
->
setZValue
(
maxZ
+
0.0001
);
mEraser
->
show
();
}
}
}
void
UBGraphicsScene
::
drawPointer
(
const
QPointF
&
pPoint
,
bool
isFirstDraw
)
{
qreal
pointerDiameter
=
UBSettings
::
pointerDiameter
/
UBApplication
::
boardController
->
currentZoom
();
...
...
@@ -456,19 +459,20 @@ void UBGraphicsScene::drawPointer(const QPointF &pPoint, bool isFirstDraw)
if
(
isFirstDraw
)
{
qreal
maxZ
=
0.
;
QList
<
QGraphicsItem
*>
allItemsList
=
items
();
for
(
int
i
=
0
;
i
<
allItemsList
.
size
();
i
++
)
{
QGraphicsItem
*
nextItem
=
allItemsList
.
at
(
i
);
qreal
zValue
=
nextItem
->
zValue
();
nextItem
->
setZValue
(
qreal
(
1
));
qDebug
()
<<
QString
(
" %1 "
).
arg
(
i
)
<<
QString
(
" %1 "
).
arg
(
zValue
);
if
(
zValue
>
maxZ
)
maxZ
=
zValue
;
nextItem
->
setZValue
(
nextItem
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
());
}
mPointer
->
setZValue
(
2
);
mPointer
->
setZValue
(
maxZ
+
0.0001
);
mPointer
->
show
();
}
}
}
...
...
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