Port "Improve touchscreen dragging"

From https://github.com/open-craft/jsinput-vectordraw/pull/32
parent f2bb3993
...@@ -409,12 +409,15 @@ function VectorDrawXBlock(runtime, element, init_args) { ...@@ -409,12 +409,15 @@ function VectorDrawXBlock(runtime, element, init_args) {
return true; return true;
}; };
VectorDraw.prototype.objectsUnderMouse = function(coords) { VectorDraw.prototype.objectsUnderMouse = function(){
var filter = function(el) { var targetObjects = [];
return !(el instanceof JXG.Image) && el.hasPoint(coords.scrCoords[1], coords.scrCoords[2]); var highlightedObjects = this.board.highlightedObjects
}; var keys = Object.keys(highlightedObjects);
return _.filter(_.values(this.board.objects), filter); for (var i = 0; i < keys.length; i++) {
}; targetObjects.push( highlightedObjects[keys[i]] );
}
return targetObjects
}
VectorDraw.prototype.onBoardDown = function(evt) { VectorDraw.prototype.onBoardDown = function(evt) {
this.pushHistory(); this.pushHistory();
......
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