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
b9f0212c
Commit
b9f0212c
authored
Feb 21, 2015
by
Fabio Bas
Browse files
Clamp the zoneviewwidget's topleft point to the scene view area; fix #754
parent
06e53275
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/zoneviewwidget.cpp
View file @
b9f0212c
...
...
@@ -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