Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Unmaintained
KDE Workspace
Commits
57083f18
Commit
57083f18
authored
Jan 12, 2013
by
Thomas Lübking
Browse files
push zoomregion on contact
BUG: 312956
parent
04e41989
Changes
1
Hide whitespace changes
Inline
Side-by-side
kwin/effects/zoom/zoom.cpp
View file @
57083f18
...
...
@@ -283,30 +283,28 @@ void ZoomEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data)
data
.
setXTranslation
(
qMin
(
0
,
qMax
(
int
(
displayWidth
()
-
displayWidth
()
*
zoom
),
int
(
displayWidth
()
/
2
-
prevPoint
.
x
()
*
zoom
))));
data
.
setYTranslation
(
qMin
(
0
,
qMax
(
int
(
displayHeight
()
-
displayHeight
()
*
zoom
),
int
(
displayHeight
()
/
2
-
prevPoint
.
y
()
*
zoom
))));
break
;
case
MouseTrackingPush
:
if
(
timeline
.
state
()
!=
QTimeLine
::
Running
)
{
case
MouseTrackingPush
:
{
// touching an edge of the screen moves the zoom-area in that direction.
int
x
=
cursorPoint
.
x
()
*
zoom
-
prevPoint
.
x
()
*
(
zoom
-
1.0
);
int
y
=
cursorPoint
.
y
()
*
zoom
-
prevPoint
.
y
()
*
(
zoom
-
1.0
);
int
threshold
=
1
;
//qMax(1, int(10.0 / zoom))
;
int
threshold
=
4
;
xMove
=
yMove
=
0
;
if
(
x
<
threshold
)
xMove
=
-
qMax
(
1.0
,
displayWidth
()
/
zoom
/
moveFactor
)
;
xMove
=
(
x
-
threshold
)
/
zoom
;
else
if
(
x
+
threshold
>
displayWidth
())
xMove
=
qMax
(
1.0
,
displayWidth
()
/
zoom
/
moveFactor
)
;
xMove
=
(
x
+
threshold
-
displayWidth
()
)
/
zoom
;
if
(
y
<
threshold
)
yMove
=
-
qMax
(
1.0
,
displayHeight
()
/
zoom
/
moveFactor
)
;
yMove
=
(
y
-
threshold
)
/
zoom
;
else
if
(
y
+
threshold
>
displayHeight
())
yMove
=
qMax
(
1.0
,
displayHeight
()
/
zoom
/
moveFactor
)
;
if
(
xMove
!=
0
||
yMove
!=
0
)
{
yMove
=
(
y
+
threshold
-
displayHeight
()
)
/
zoom
;
if
(
xMove
)
prevPoint
.
setX
(
qMax
(
0
,
qMin
(
displayWidth
(),
prevPoint
.
x
()
+
xMove
)));
if
(
yMove
)
prevPoint
.
setY
(
qMax
(
0
,
qMin
(
displayHeight
(),
prevPoint
.
y
()
+
yMove
)));
timeline
.
start
();
}
data
.
setXTranslation
(
-
int
(
prevPoint
.
x
()
*
(
zoom
-
1.0
)));
data
.
setYTranslation
(
-
int
(
prevPoint
.
y
()
*
(
zoom
-
1.0
)));
break
;
}
data
.
setXTranslation
(
-
int
(
prevPoint
.
x
()
*
(
zoom
-
1.0
)));
data
.
setYTranslation
(
-
int
(
prevPoint
.
y
()
*
(
zoom
-
1.0
)));
break
;
}
// use the focusPoint if focus tracking is enabled
...
...
Write
Preview
Supports
Markdown
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