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
72f944bd
Commit
72f944bd
authored
12 years ago
by
Ilia Ryabokon
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
7a4edf75
4e691d51
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
5 deletions
+81
-5
UBBoardController.cpp
src/board/UBBoardController.cpp
+6
-5
UBGraphicsDelegateFrame.cpp
src/domain/UBGraphicsDelegateFrame.cpp
+69
-0
UBGraphicsDelegateFrame.h
src/domain/UBGraphicsDelegateFrame.h
+6
-0
No files found.
src/board/UBBoardController.cpp
View file @
72f944bd
...
@@ -1466,12 +1466,13 @@ void UBBoardController::ClearUndoStack()
...
@@ -1466,12 +1466,13 @@ void UBBoardController::ClearUndoStack()
while
(
itUniq
.
hasNext
())
while
(
itUniq
.
hasNext
())
{
{
QGraphicsItem
*
item
=
itUniq
.
next
();
QGraphicsItem
*
item
=
itUniq
.
next
();
UBGraphicsScene
*
scene
=
NULL
;
if
(
item
->
scene
())
{
if
(
item
->
scene
())
{
UBGraphicsScene
*
scene
=
dynamic_cast
<
UBGraphicsScene
*>
(
item
->
scene
());
scene
=
dynamic_cast
<
UBGraphicsScene
*>
(
item
->
scene
());
if
(
!
scene
)
}
{
if
(
!
scene
)
mActiveScene
->
deleteItem
(
item
);
{
}
mActiveScene
->
deleteItem
(
item
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/domain/UBGraphicsDelegateFrame.cpp
View file @
72f944bd
...
@@ -228,6 +228,9 @@ void UBGraphicsDelegateFrame::mousePressEvent(QGraphicsSceneMouseEvent *event)
...
@@ -228,6 +228,9 @@ void UBGraphicsDelegateFrame::mousePressEvent(QGraphicsSceneMouseEvent *event)
mCurrentTool
=
toolFromPos
(
event
->
pos
());
mCurrentTool
=
toolFromPos
(
event
->
pos
());
setCursorFromAngle
(
QString
(
""
));
setCursorFromAngle
(
QString
(
""
));
event
->
accept
();
event
->
accept
();
prepareFramesToMove
(
getLinkedFrames
());
}
}
void
UBGraphicsDelegateFrame
::
setCursorFromAngle
(
QString
angle
)
void
UBGraphicsDelegateFrame
::
setCursorFromAngle
(
QString
angle
)
...
@@ -469,6 +472,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
...
@@ -469,6 +472,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
{
mTranslateX
=
move
.
dx
();
mTranslateX
=
move
.
dx
();
mTranslateY
=
move
.
dy
();
mTranslateY
=
move
.
dy
();
moveLinkedItems
(
move
);
}
}
QTransform
tr
=
buildTransform
();
QTransform
tr
=
buildTransform
();
...
@@ -534,6 +538,71 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
...
@@ -534,6 +538,71 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
event
->
accept
();
event
->
accept
();
}
}
QList
<
UBGraphicsDelegateFrame
*>
UBGraphicsDelegateFrame
::
getLinkedFrames
()
{
QList
<
UBGraphicsDelegateFrame
*>
linkedFrames
;
QList
<
QGraphicsItem
*>
sItems
=
mDelegate
->
delegated
()
->
scene
()
->
selectedItems
();
if
(
sItems
.
count
())
{
sItems
.
removeAll
(
delegated
());
foreach
(
QGraphicsItem
*
item
,
sItems
)
{
UBGraphicsItem
*
gitem
=
dynamic_cast
<
UBGraphicsItem
*>
(
item
);
if
(
gitem
)
linkedFrames
<<
gitem
->
Delegate
()
->
frame
();
}
}
return
linkedFrames
;
}
void
UBGraphicsDelegateFrame
::
prepareFramesToMove
(
QList
<
UBGraphicsDelegateFrame
*>
framesToMove
)
{
mLinkedFrames
=
framesToMove
;
foreach
(
UBGraphicsDelegateFrame
*
frame
,
mLinkedFrames
)
{
frame
->
prepareLinkedFrameToMove
();
}
}
void
UBGraphicsDelegateFrame
::
prepareLinkedFrameToMove
()
{
mDelegate
->
startUndoStep
();
mStartingPoint
=
QPointF
(
0
,
0
);
initializeTransform
();
mScaleX
=
1
;
mScaleY
=
1
;
mTranslateX
=
0
;
mTranslateY
=
0
;
mAngleOffset
=
0
;
mInitialTransform
=
buildTransform
();
mCurrentTool
=
Move
;
}
void
UBGraphicsDelegateFrame
::
moveLinkedItems
(
QLineF
movingVector
,
bool
bLinked
)
{
if
(
bLinked
)
{
mCurrentTool
=
Move
;
mTranslateX
=
movingVector
.
dx
();
mTranslateY
=
movingVector
.
dy
();
delegated
()
->
setTransform
(
buildTransform
(),
false
);
}
else
{
foreach
(
UBGraphicsDelegateFrame
*
frame
,
mLinkedFrames
)
{
frame
->
moveLinkedItems
(
movingVector
,
true
);
}
}
}
QTransform
UBGraphicsDelegateFrame
::
buildTransform
()
QTransform
UBGraphicsDelegateFrame
::
buildTransform
()
{
{
...
...
This diff is collapsed.
Click to expand it.
src/domain/UBGraphicsDelegateFrame.h
View file @
72f944bd
...
@@ -48,6 +48,10 @@ class UBGraphicsDelegateFrame: public QGraphicsRectItem, public QObject
...
@@ -48,6 +48,10 @@ class UBGraphicsDelegateFrame: public QGraphicsRectItem, public QObject
enum
OperationMode
{
Scaling
,
Resizing
,
ResizingHorizontally
};
enum
OperationMode
{
Scaling
,
Resizing
,
ResizingHorizontally
};
void
setOperationMode
(
OperationMode
pMode
)
{
mOperationMode
=
pMode
;}
void
setOperationMode
(
OperationMode
pMode
)
{
mOperationMode
=
pMode
;}
bool
isResizing
(){
return
mResizing
;}
bool
isResizing
(){
return
mResizing
;}
void
moveLinkedItems
(
QLineF
movingVector
,
bool
bLinked
=
false
);
void
prepareFramesToMove
(
QList
<
UBGraphicsDelegateFrame
*>
framesToMove
);
void
prepareLinkedFrameToMove
();
QList
<
UBGraphicsDelegateFrame
*>
getLinkedFrames
();
private
:
private
:
QRectF
bottomRightResizeGripRect
()
const
;
QRectF
bottomRightResizeGripRect
()
const
;
...
@@ -120,5 +124,7 @@ class UBGraphicsDelegateFrame: public QGraphicsRectItem, public QObject
...
@@ -120,5 +124,7 @@ class UBGraphicsDelegateFrame: public QGraphicsRectItem, public QObject
bool
mResizing
;
bool
mResizing
;
bool
mMirroredXAtStart
;
bool
mMirroredXAtStart
;
bool
mMirroredYAtStart
;
bool
mMirroredYAtStart
;
QList
<
UBGraphicsDelegateFrame
*>
mLinkedFrames
;
};
};
#endif
/* UBGRAPHICSDELEGATEFRAME_H_ */
#endif
/* UBGRAPHICSDELEGATEFRAME_H_ */
This diff is collapsed.
Click to expand it.
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