Merge branch 'master' of github.com:scriptographer/paper.js

This commit is contained in:
Jürg Lehni 2011-05-07 14:18:50 +01:00
commit 4bd12feb49
2 changed files with 8 additions and 9 deletions

View file

@ -42,16 +42,14 @@
vector.length = 10;
mouseDown = false;
}
function onFrame() {
if (!mouseDown)
iterate();
}
var grow = false;
var vector = new Point(150, 0);
setInterval(draw, 30);
function draw() {
if (!mouseDown) {
iterate();
document.redraw();
}
}
function iterate() {
for (var i = 0, l = gradient.stops.length; i < l; i++)
@ -73,7 +71,8 @@
var radius = Math.max(document.size.height, document.size.width) * 0.75;
var gradientColor = path.fillColor;
gradientColor.origin = point;
gradientColor.origin = point + radius;
var radius = Math.max(document.size.height, document.size.width) * 0.75;
gradientColor.destination = point + [radius, 0];
}
});
</script>

View file

@ -46,7 +46,7 @@ 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.targetTouches)
if (event && event.targetTouches)
event.preventDefault();
var point = event && viewToArtwork(event, that._document);
// If there is only an onMouseMove handler, call it when