Skip to content

Commit 96e1765

Browse files
committed
Do not implicitly use getTool() getter since it creates tools when none exists.
1 parent 97fdfcd commit 96e1765

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/ui/Key.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ var Key = this.Key = new function() {
7171
type = down ? 'keydown' : 'keyup',
7272
view = View._focused,
7373
scope = view && view.isVisible() && view._scope,
74-
tool = scope && scope.tool;
74+
tool = scope && scope._tool;
7575
keyMap[key] = down;
7676
if (tool && tool.responds(type)) {
7777
// Call the onKeyDown or onKeyUp handler if present

src/ui/View.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{
510510
// CanvasView, and then handle the active tool, if any.
511511
if (view._onMouseDown)
512512
view._onMouseDown(event, curPoint);
513-
if (tool = view._scope.tool)
513+
if (tool = view._scope._tool)
514514
tool._onHandleEvent('mousedown', curPoint, event);
515515
// In the end we always call draw(), but pass checkRedraw = true, so we
516516
// only redraw the view if anything has changed in the above calls.
@@ -539,7 +539,7 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{
539539
var point = event && viewToProject(view, event);
540540
if (view._onMouseMove)
541541
view._onMouseMove(event, point);
542-
if (tool = view._scope.tool) {
542+
if (tool = view._scope._tool) {
543543
var onlyMove = !!(!tool.onMouseDrag && tool.onMouseMove);
544544
if (dragging && !onlyMove) {
545545
if ((curPoint = point || curPoint)

0 commit comments

Comments
 (0)