Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
f2788a30
Commit
f2788a30
authored
Apr 30, 2015
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrected way of storing cursor coordinates for context
parent
787415c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
tool_manager.cpp
common/tool/tool_manager.cpp
+3
-1
view_controls.h
include/view/view_controls.h
+5
-1
No files found.
common/tool/tool_manager.cpp
View file @
f2788a30
...
...
@@ -594,6 +594,8 @@ void TOOL_MANAGER::dispatchContextMenu( const TOOL_EVENT& aEvent )
// Temporarily store the cursor position, so the tools could execute actions
// using the point where the user has invoked a context menu
bool
forcedCursor
=
m_viewControls
->
IsCursorPositionForced
();
VECTOR2D
cursorPos
=
m_viewControls
->
GetCursorPosition
();
m_viewControls
->
ForceCursorPosition
(
true
,
m_viewControls
->
GetCursorPosition
()
);
// Run update handlers
...
...
@@ -609,7 +611,7 @@ void TOOL_MANAGER::dispatchContextMenu( const TOOL_EVENT& aEvent )
dispatchInternal
(
evt
);
}
m_viewControls
->
ForceCursorPosition
(
f
alse
);
m_viewControls
->
ForceCursorPosition
(
f
orcedCursor
,
cursorPos
);
break
;
}
...
...
include/view/view_controls.h
View file @
f2788a30
...
...
@@ -152,7 +152,6 @@ public:
*/
virtual
VECTOR2D
GetCursorPosition
()
const
=
0
;
/**
* Function ForceCursorPosition()
* Places the cursor immediately at a given point. Mouse movement is ignored.
...
...
@@ -182,6 +181,11 @@ public:
m_cursorCaptured
=
aEnabled
;
}
inline
bool
IsCursorPositionForced
()
const
{
return
m_forceCursorPosition
;
}
protected
:
/// Sets center for VIEW, takes into account panning boundaries.
void
setCenter
(
const
VECTOR2D
&
aCenter
);
...
...
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