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) {
return true;
};
VectorDraw.prototype.objectsUnderMouse = function(coords) {
var filter = function(el) {
return !(el instanceof JXG.Image) && el.hasPoint(coords.scrCoords[1], coords.scrCoords[2]);
};
return _.filter(_.values(this.board.objects), filter);
};
VectorDraw.prototype.objectsUnderMouse = function(){
var targetObjects = [];
var highlightedObjects = this.board.highlightedObjects
var keys = Object.keys(highlightedObjects);
for (var i = 0; i < keys.length; i++) {
targetObjects.push( highlightedObjects[keys[i]] );
}
return targetObjects
}
VectorDraw.prototype.onBoardDown = function(evt) {
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