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
c4f4343b
Commit
c4f4343b
authored
Aug 22, 2012
by
Aleksei Kanash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed scaling of rotated and mirrored images.
parent
370e5b37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
18 deletions
+9
-18
UBGraphicsDelegateFrame.cpp
src/domain/UBGraphicsDelegateFrame.cpp
+9
-18
No files found.
src/domain/UBGraphicsDelegateFrame.cpp
View file @
c4f4343b
...
...
@@ -477,29 +477,20 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QTransform
tr
=
buildTransform
();
//TODO UB 4.x: Could find a better solution ?
if
(
resizingRight
()
||
resizingBottom
()
||
resizingBottomRight
())
{
QPointF
ref
;
if
(
!
mMirrorX
&&
!
mMirrorY
){
ref
=
delegated
()
->
boundingRect
().
topLeft
();
}
else
if
(
mMirrorX
&&
!
mMirrorY
){
ref
=
delegated
()
->
boundingRect
().
topLeft
();
}
else
if
(
!
mMirrorX
&&
mMirrorY
){
ref
=
delegated
()
->
boundingRect
().
topLeft
();
}
else
if
(
mMirrorX
&&
mMirrorY
){
ref
=
delegated
()
->
boundingRect
().
topRight
();
}
// Map the item topleft point to the current mouse move transform
QPointF
topLeft
=
tr
.
map
(
ref
);
// Map the item topleft point to the mouse press transform
QPointF
fixedPoint
=
mInitialTransform
.
map
(
ref
);
// we just detects coordinates of corner before and after scaling and then moves object at diff between them.
if
(
resizingBottomRight
()
&&
mMirrorX
)
mTranslateX
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
x
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
x
();
else
mTranslateX
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
topLeft
()).
x
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
topLeft
()).
x
();
// Update the translation coordinates
mTranslateX
+=
fixedPoint
.
x
()
-
topLeft
.
x
();
mTranslateY
+=
fixedPoint
.
y
()
-
topLeft
.
y
();
if
(
resizingBottomRight
()
&&
mMirrorY
)
mTranslateY
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
y
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
bottomRight
()).
y
();
else
mTranslateY
+=
mInitialTransform
.
map
(
delegated
()
->
boundingRect
().
topLeft
()).
y
()
-
tr
.
map
(
delegated
()
->
boundingRect
().
topLeft
()).
y
();
// Update the transform
tr
=
buildTransform
();
...
...
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