Merge remote-tracking branch 'origin/master'

Conflicts:
	src/tool/Tool.js
This commit is contained in:
Jürg Lehni 2011-05-14 15:27:56 +01:00
commit c89fcdcb2e
2 changed files with 13 additions and 4 deletions

View file

@ -15,13 +15,21 @@
*/ */
var CompoundPath = this.CompoundPath = PathItem.extend({ 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.base();
this.children = []; this.children = [];
if (items) { 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]); this.appendTop(items[i]);
} }
}
}, },
/** /**

View file

@ -49,7 +49,8 @@ var Tool = this.Tool = ToolHandler.extend(new function() {
// If the event was triggered by a touch screen device, // If the event was triggered by a touch screen device,
// prevent the default behaviour, as it will otherwise // prevent the default behaviour, as it will otherwise
// scroll the page: // scroll the page:
if (event && event.targetTouches) { var touchDevice = event && event.targetTouches;
if (touchDevice) {
DomEvent.preventDefault(event); DomEvent.preventDefault(event);
} }
var point = event && viewToArtwork(event, that._document); var point = event && viewToArtwork(event, that._document);
@ -64,7 +65,7 @@ var Tool = this.Tool = ToolHandler.extend(new function() {
} else if (!dragging || onlyMove) { } else if (!dragging || onlyMove) {
that.onHandleEvent('mousemove', point, event); that.onHandleEvent('mousemove', point, event);
} }
if (that.onMouseMove || that.onMouseDrag) { if (that.onMouseMove || touchDevice && that.onMouseDrag) {
that._document.redraw(); that._document.redraw();
} }
}, },