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
98b639bc
Commit
98b639bc
authored
Sep 03, 2012
by
Aleksei Kanash
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'aleksei_kanash_dev' into develop
parents
0bf197a3
aa54bed9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
24 deletions
+23
-24
UBBoardController.cpp
src/board/UBBoardController.cpp
+6
-6
UBGraphicsPolygonItem.cpp
src/domain/UBGraphicsPolygonItem.cpp
+9
-11
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+1
-1
UBGraphicsStrokesGroup.cpp
src/domain/UBGraphicsStrokesGroup.cpp
+7
-6
No files found.
src/board/UBBoardController.cpp
View file @
98b639bc
...
...
@@ -553,15 +553,15 @@ void UBBoardController::duplicateItem(UBItem *item)
qreal
shifting
=
UBSettings
::
settings
()
->
objectFrameWidth
;
itemPos
=
commonItem
->
pos
()
+
QPointF
(
shifting
,
shifting
);
itemSize
=
commonItem
->
boundingRect
().
size
();
commonItem
->
setSelected
(
false
);
}
UBMimeType
::
Enum
itemMimeType
;
QString
contentTypeHeader
=
UBFileSystemUtils
::
mimeTypeFromFileName
(
item
->
sourceUrl
().
toLocalFile
());
if
(
NULL
!=
qgraphicsitem_cast
<
UBGraphicsGroupContainerItem
*>
(
commonItem
))
{
if
(
NULL
!=
qgraphicsitem_cast
<
UBGraphicsGroupContainerItem
*>
(
commonItem
))
itemMimeType
=
UBMimeType
::
Group
;
}
else
{
else
itemMimeType
=
UBFileSystemUtils
::
mimeTypeFromString
(
contentTypeHeader
);
}
switch
(
static_cast
<
int
>
(
itemMimeType
))
{
...
...
@@ -633,10 +633,10 @@ void UBBoardController::duplicateItem(UBItem *item)
QGraphicsItem
*
gitem
=
dynamic_cast
<
QGraphicsItem
*>
(
item
->
deepCopy
());
if
(
gitem
)
{
qDebug
()
<<
"Adding a stroke: "
<<
gitem
;
mActiveScene
->
addItem
(
gitem
);
gitem
->
setPos
(
itemPos
);
mLastCreatedItem
=
gitem
;
gitem
->
setSelected
(
true
);
}
return
;
}
break
;
...
...
src/domain/UBGraphicsPolygonItem.cpp
View file @
98b639bc
...
...
@@ -143,13 +143,13 @@ QColor UBGraphicsPolygonItem::color() const
UBItem
*
UBGraphicsPolygonItem
::
deepCopy
()
const
{
UBGraphicsPolygonItem
*
copy
=
new
UBGraphicsPolygonItem
(
polygon
(),
parentItem
());
UBGraphicsPolygonItem
*
copy
=
new
UBGraphicsPolygonItem
(
polygon
(),
0
);
UBGraphicsStroke
*
stroke
=
new
UBGraphicsStroke
();
copyItemParameters
(
copy
);
copy
->
mOriginalLine
=
this
->
mOriginalLine
;
copy
->
mOriginalWidth
=
this
->
mOriginalWidth
;
copy
->
mIsNominalLine
=
this
->
mIsNominalLine
;
copy
->
setStroke
(
stroke
);
return
copy
;
}
...
...
@@ -160,17 +160,15 @@ void UBGraphicsPolygonItem::copyItemParameters(UBItem *copy) const
UBGraphicsPolygonItem
*
cp
=
dynamic_cast
<
UBGraphicsPolygonItem
*>
(
copy
);
if
(
cp
)
{
cp
->
mOriginalLine
=
QLineF
()
;
cp
->
mOriginalWidth
=
-
1
;
cp
->
mIsNominalLine
=
fals
e
;
cp
->
mOriginalLine
=
this
->
mOriginalLine
;
cp
->
mOriginalWidth
=
this
->
mOriginalWidth
;
cp
->
mIsNominalLine
=
this
->
mIsNominalLin
e
;
cp
->
setStroke
(
this
->
stroke
());
cp
->
setStrokesGroup
(
this
->
strokesGroup
());
cp
->
setTransform
(
transform
());
cp
->
setBrush
(
this
->
brush
());
cp
->
setPen
(
this
->
pen
());
cp
->
mHasAlpha
=
this
->
mHasAlpha
;
cp
->
setColorOnDarkBackground
(
this
->
colorOnDarkBackground
());
cp
->
setColorOnLightBackground
(
this
->
colorOnLightBackground
());
...
...
src/domain/UBGraphicsScene.cpp
View file @
98b639bc
...
...
@@ -1615,6 +1615,7 @@ void UBGraphicsScene::addItems(const QSet<QGraphicsItem*>& items)
void
UBGraphicsScene
::
removeItem
(
QGraphicsItem
*
item
)
{
setModified
(
true
);
item
->
setSelected
(
false
);
UBCoreGraphicsScene
::
removeItem
(
item
);
UBApplication
::
boardController
->
freezeW3CWidget
(
item
,
true
);
...
...
@@ -2235,7 +2236,6 @@ void UBGraphicsScene::keyReleaseEvent(QKeyEvent * keyEvent)
default
:
{
item
->
setSelected
(
false
);
UBGraphicsItem
*
ubgi
=
dynamic_cast
<
UBGraphicsItem
*>
(
item
);
if
(
0
!=
ubgi
)
ubgi
->
remove
();
...
...
src/domain/UBGraphicsStrokesGroup.cpp
View file @
98b639bc
...
...
@@ -67,14 +67,16 @@ UBItem* UBGraphicsStrokesGroup::deepCopy() const
{
UBGraphicsStrokesGroup
*
copy
=
new
UBGraphicsStrokesGroup
();
QList
<
QGraphicsItem
*>
chl
=
childItems
();
foreach
(
QGraphicsItem
*
child
,
chl
)
{
UBGraphicsPolygonItem
*
polygon
=
dynamic_cast
<
UBGraphicsPolygonItem
*>
(
child
);
if
(
polygon
)
{
copy
->
addToGroup
(
dynamic_cast
<
QGraphicsItem
*>
(
polygon
->
deepCopy
()));
polygon
->
setStrokesGroup
(
copy
);
}
}
copyItemParameters
(
copy
);
...
...
@@ -85,9 +87,8 @@ void UBGraphicsStrokesGroup::copyItemParameters(UBItem *copy) const
{
UBGraphicsStrokesGroup
*
cp
=
dynamic_cast
<
UBGraphicsStrokesGroup
*>
(
copy
);
{
cp
->
set
Pos
(
this
->
pos
());
cp
->
set
Transform
(
transform
());
cp
->
setTransform
(
this
->
transform
());
cp
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
cp
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
cp
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
...
...
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