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
Graphics
Okular
Commits
1ef69293
Commit
1ef69293
authored
Dec 16, 2012
by
Albert Astals Cid
Browse files
Don't ignore mouse movements on the annotator when not on the locked item
REVIEW: 107726
BUGS: 310572
parent
7333dd14
Changes
1
Hide whitespace changes
Inline
Side-by-side
ui/pageviewannotator.cpp
View file @
1ef69293
...
...
@@ -733,25 +733,26 @@ QRect PageViewAnnotator::performRouteMouseOrTabletEvent(const AnnotatorEngine::E
return
QRect
();
}
// find out normalized mouse coords inside current item
const
QRect
&
itemRect
=
item
->
uncroppedGeometry
();
const
QPointF
eventPos
=
m_pageView
->
contentAreaPoint
(
pos
);
double
nX
=
item
->
absToPageX
(
eventPos
.
x
()
);
double
nY
=
item
->
absToPageY
(
eventPos
.
y
()
);
QRect
modifiedRect
;
// 1. lock engine to current item
if
(
m_lockedItem
&&
item
!=
m_lockedItem
)
return
QRect
();
if
(
!
m_lockedItem
&&
eventType
==
AnnotatorEngine
::
Press
)
{
m_lockedItem
=
item
;
m_engine
->
setItem
(
m_lockedItem
);
}
if
(
!
m_lockedItem
)
{
return
QRect
();
}
// find out normalized mouse coords inside current item
const
QRect
&
itemRect
=
m_lockedItem
->
uncroppedGeometry
();
const
QPointF
eventPos
=
m_pageView
->
contentAreaPoint
(
pos
);
double
nX
=
m_lockedItem
->
absToPageX
(
eventPos
.
x
()
);
double
nY
=
m_lockedItem
->
absToPageY
(
eventPos
.
y
()
);
QRect
modifiedRect
;
// 2. use engine to perform operations
const
QRect
paintRect
=
m_engine
->
event
(
eventType
,
button
,
nX
,
nY
,
itemRect
.
width
(),
itemRect
.
height
(),
i
tem
->
page
()
);
const
QRect
paintRect
=
m_engine
->
event
(
eventType
,
button
,
nX
,
nY
,
itemRect
.
width
(),
itemRect
.
height
(),
m_lockedI
tem
->
page
()
);
// 3. update absolute extents rect and send paint event(s)
if
(
paintRect
.
isValid
()
)
...
...
@@ -784,7 +785,7 @@ QRect PageViewAnnotator::performRouteMouseOrTabletEvent(const AnnotatorEngine::E
m_document
->
addPageAnnotation
(
m_lockedItem
->
pageNumber
(),
annotation
);
if
(
annotation
->
openDialogAfterCreation
()
)
m_pageView
->
openAnnotationWindow
(
annotation
,
i
tem
->
pageNumber
()
);
m_pageView
->
openAnnotationWindow
(
annotation
,
m_lockedI
tem
->
pageNumber
()
);
}
if
(
m_continuousMode
)
...
...
@@ -798,8 +799,6 @@ QRect PageViewAnnotator::performRouteMouseOrTabletEvent(const AnnotatorEngine::E
QRect
PageViewAnnotator
::
routeMouseEvent
(
QMouseEvent
*
e
,
PageViewItem
*
item
)
{
if
(
!
item
)
return
QRect
();
AnnotatorEngine
::
EventType
eventType
;
AnnotatorEngine
::
Button
button
;
...
...
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