Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
a984a9ea
Commit
a984a9ea
authored
Feb 22, 2015
by
Gavin Bisesi
Browse files
Merge pull request #773 from ctrlaltca/fix_754
Clamp the zoneviewwidget's topleft point to the scene view area; fix #754
parents
e423fb2a
b9f0212c
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/zoneviewwidget.cpp
View file @
a984a9ea
...
...
@@ -185,6 +185,24 @@ void ZoneViewWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
void
ZoneViewWidget
::
moveWidget
(
QPointF
scenePos
)
{
if
(
scenePos
.
x
()
<
0
)
{
scenePos
.
setX
(
0
);
}
else
{
qreal
maxw
=
scene
()
->
sceneRect
().
width
()
-
100
;
if
(
scenePos
.
x
()
>
maxw
)
scenePos
.
setX
(
maxw
);
}
if
(
scenePos
.
y
()
<
0
)
{
scenePos
.
setY
(
0
);
}
else
{
qreal
maxh
=
scene
()
->
sceneRect
().
height
()
-
100
;
if
(
scenePos
.
y
()
>
maxh
)
scenePos
.
setY
(
maxh
);
}
setPos
(
scenePos
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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