Address comment from Eugeny

parent d27bd465
...@@ -409,7 +409,7 @@ function VectorDrawXBlock(runtime, element, init_args) { ...@@ -409,7 +409,7 @@ function VectorDrawXBlock(runtime, element, init_args) {
return true; return true;
}; };
VectorDraw.prototype.objectsUnderMouse = function(){ VectorDraw.prototype.objectsUnderMouse = function() {
var targetObjects = []; var targetObjects = [];
var highlightedObjects = this.board.highlightedObjects var highlightedObjects = this.board.highlightedObjects
var keys = Object.keys(highlightedObjects); var keys = Object.keys(highlightedObjects);
...@@ -424,7 +424,7 @@ function VectorDrawXBlock(runtime, element, init_args) { ...@@ -424,7 +424,7 @@ function VectorDrawXBlock(runtime, element, init_args) {
// Can't create a vector if none is selected from the list. // Can't create a vector if none is selected from the list.
var selected = this.getSelectedElement(); var selected = this.getSelectedElement();
var coords = this.getMouseCoords(evt); var coords = this.getMouseCoords(evt);
var targetObjects = this.objectsUnderMouse(coords); var targetObjects = this.objectsUnderMouse();
if (!_.isEmpty(selected) && (!targetObjects || _.all(targetObjects, this.canCreateVectorOnTopOf.bind(this)))) { if (!_.isEmpty(selected) && (!targetObjects || _.all(targetObjects, this.canCreateVectorOnTopOf.bind(this)))) {
var point_coords = [coords.usrCoords[1], coords.usrCoords[2]]; var point_coords = [coords.usrCoords[1], coords.usrCoords[2]];
if (selected.type === 'vector') { if (selected.type === 'vector') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment