mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Merge remote-tracking branch 'origin/master'
Conflicts: src/tool/Tool.js
This commit is contained in:
commit
c89fcdcb2e
2 changed files with 13 additions and 4 deletions
|
@ -15,12 +15,20 @@
|
|||
*/
|
||||
|
||||
var CompoundPath = this.CompoundPath = PathItem.extend({
|
||||
initialize: function(items) {
|
||||
// PORT: port the reversing of segments and keepDirection flag
|
||||
initialize: function(items, keepDirection) {
|
||||
this.base();
|
||||
this.children = [];
|
||||
if (items) {
|
||||
for (var i = 0, l = items.length; i < l; i++)
|
||||
for (var i = 0, l = items.length; i < l; i++) {
|
||||
var item = items[i];
|
||||
// All paths except for the first one are reversed when
|
||||
// creating a compound path, so that they draw holes.
|
||||
// When keepDirection is set to true, child paths aren't reversed.
|
||||
if (!keepDirection && i != l - 1)
|
||||
item.reverse();
|
||||
this.appendTop(items[i]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -49,7 +49,8 @@ var Tool = this.Tool = ToolHandler.extend(new function() {
|
|||
// If the event was triggered by a touch screen device,
|
||||
// prevent the default behaviour, as it will otherwise
|
||||
// scroll the page:
|
||||
if (event && event.targetTouches) {
|
||||
var touchDevice = event && event.targetTouches;
|
||||
if (touchDevice) {
|
||||
DomEvent.preventDefault(event);
|
||||
}
|
||||
var point = event && viewToArtwork(event, that._document);
|
||||
|
@ -64,7 +65,7 @@ var Tool = this.Tool = ToolHandler.extend(new function() {
|
|||
} else if (!dragging || onlyMove) {
|
||||
that.onHandleEvent('mousemove', point, event);
|
||||
}
|
||||
if (that.onMouseMove || that.onMouseDrag) {
|
||||
if (that.onMouseMove || touchDevice && that.onMouseDrag) {
|
||||
that._document.redraw();
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue