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
ed432370
Commit
ed432370
authored
Apr 16, 2012
by
shibakaneki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finished the mirroring implementation
parent
8ce99065
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
18 deletions
+3
-18
UBGraphicsDelegateFrame.cpp
src/domain/UBGraphicsDelegateFrame.cpp
+3
-17
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+0
-1
No files found.
src/domain/UBGraphicsDelegateFrame.cpp
View file @
ed432370
...
...
@@ -446,11 +446,11 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
if
(
!
mMirrorX
&&
!
mMirrorY
){
ref
=
delegated
()
->
boundingRect
().
topLeft
();
}
else
if
(
mMirrorX
&&
!
mMirrorY
){
ref
=
delegated
()
->
boundingRect
().
top
Righ
t
();
ref
=
delegated
()
->
boundingRect
().
top
Lef
t
();
}
else
if
(
!
mMirrorX
&&
mMirrorY
){
ref
=
delegated
()
->
boundingRect
().
bottom
Left
();
ref
=
delegated
()
->
boundingRect
().
top
Left
();
}
else
if
(
mMirrorX
&&
mMirrorY
){
ref
=
delegated
()
->
boundingRect
().
bottom
Right
();
ref
=
delegated
()
->
boundingRect
().
top
Right
();
}
// Map the item topleft point to the current mouse move transform
...
...
@@ -578,8 +578,6 @@ void UBGraphicsDelegateFrame::setVisible(bool visible)
void
UBGraphicsDelegateFrame
::
positionHandles
()
{
// TODO: Check why the height is modified if the user rotates the item more than 90°
QRectF
itemRect
=
delegated
()
->
boundingRect
();
QTransform
itemTransform
=
delegated
()
->
sceneTransform
();
QPointF
topLeft
=
itemTransform
.
map
(
itemRect
.
topLeft
());
...
...
@@ -619,7 +617,6 @@ void UBGraphicsDelegateFrame::positionHandles()
if
(
mVisible
)
{
qDebug
()
<<
center
.
y
();
setRect
(
center
.
x
()
-
mFrameWidth
-
width
/
2
,
center
.
y
()
-
mFrameWidth
-
h
/
2
,
width
+
2
*
mFrameWidth
,
h
+
2
*
mFrameWidth
);
}
else
...
...
@@ -711,38 +708,30 @@ UBGraphicsDelegateFrame::FrameTool UBGraphicsDelegateFrame::toolFromPos(QPointF
return
ResizeBottomRight
;
else
if
(
bottomResizeGripRect
().
contains
(
pos
)){
if
(
mMirrorY
){
qDebug
()
<<
"Top"
;
return
ResizeTop
;
}
else
{
qDebug
()
<<
"Bottom"
;
return
ResizeBottom
;
}
}
else
if
(
leftResizeGripRect
().
contains
(
pos
)){
if
(
mMirrorX
){
qDebug
()
<<
"Right"
;
return
ResizeRight
;
}
else
{
qDebug
()
<<
"Left"
;
return
ResizeLeft
;
}
return
ResizeLeft
;
}
else
if
(
rightResizeGripRect
().
contains
(
pos
)){
if
(
mMirrorX
){
qDebug
()
<<
"Left"
;
return
ResizeLeft
;
}
else
{
qDebug
()
<<
"Right"
;
return
ResizeRight
;
}
}
else
if
(
topResizeGripRect
().
contains
(
pos
)){
if
(
mMirrorY
){
qDebug
()
<<
"Bottom"
;
return
ResizeBottom
;
}
else
{
qDebug
()
<<
"Top"
;
return
ResizeTop
;
}
}
...
...
@@ -796,11 +785,8 @@ void UBGraphicsDelegateFrame::refreshGeometry()
QPointF
topLeft
=
itemTransform
.
map
(
itemRect
.
topLeft
());
QPointF
topRight
=
itemTransform
.
map
(
itemRect
.
topRight
());
QPointF
bottomLeft
=
itemTransform
.
map
(
itemRect
.
bottomLeft
());
QPointF
center
=
itemTransform
.
map
(
itemRect
.
center
());
QLineF
topLine
(
topLeft
,
topRight
);
qreal
angle
=
topLine
.
angle
();
qreal
width
=
topLine
.
length
();
QLineF
leftLine
(
topLeft
,
bottomLeft
);
qreal
height
=
leftLine
.
length
();
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
ed432370
...
...
@@ -499,7 +499,6 @@ void UBGraphicsItemDelegate::updateMenuActionState()
}
}
void
UBGraphicsItemDelegate
::
showMenu
()
{
if
(
!
mMenu
)
...
...
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