From 1607d744eff93cc27666ee12939e9dfa098d7e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 5 Mar 2011 22:02:53 +0000 Subject: [PATCH] Implicitely call document.redraw() at the end of PaperScript execution. --- examples/Scripts/arcTo.html | 1 - examples/Scripts/circle.html | 1 - examples/Scripts/letter.html | 1 - examples/Scripts/rectangle.html | 1 - examples/Scripts/star.html | 1 - examples/Scripts/strokeJoin.html | 1 - src/util/PaperScript.js | 3 +++ 7 files changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/Scripts/arcTo.html b/examples/Scripts/arcTo.html index 03b6aa1c..ae8a1189 100644 --- a/examples/Scripts/arcTo.html +++ b/examples/Scripts/arcTo.html @@ -53,7 +53,6 @@ } document.activeLayer.appendBottom(path); } - document.redraw(); diff --git a/examples/Scripts/circle.html b/examples/Scripts/circle.html index a183e16a..28b81e2c 100644 --- a/examples/Scripts/circle.html +++ b/examples/Scripts/circle.html @@ -41,7 +41,6 @@ var path = new Path.Circle(center, i * 5); path.strokeColor = 'black'; } - document.redraw(); diff --git a/examples/Scripts/letter.html b/examples/Scripts/letter.html index ca91f6e1..d4f8369b 100644 --- a/examples/Scripts/letter.html +++ b/examples/Scripts/letter.html @@ -54,7 +54,6 @@ ); letterPath.closed = true; letterPath.fillColor = 'black'; - document.redraw(); diff --git a/examples/Scripts/rectangle.html b/examples/Scripts/rectangle.html index f6266b6a..f2a6b9be 100644 --- a/examples/Scripts/rectangle.html +++ b/examples/Scripts/rectangle.html @@ -38,7 +38,6 @@ diff --git a/examples/Scripts/star.html b/examples/Scripts/star.html index af14d62d..b3eeb13c 100644 --- a/examples/Scripts/star.html +++ b/examples/Scripts/star.html @@ -51,7 +51,6 @@ path.smooth(); document.activeLayer.appendBottom(path); } - document.redraw(); diff --git a/examples/Scripts/strokeJoin.html b/examples/Scripts/strokeJoin.html index 9b720532..8035871a 100644 --- a/examples/Scripts/strokeJoin.html +++ b/examples/Scripts/strokeJoin.html @@ -69,7 +69,6 @@ path.strokeJoin = 'miter'; path.strokeCap = 'butt'; console.log(path.segments); - document.redraw(); diff --git a/src/util/PaperScript.js b/src/util/PaperScript.js index 5a0560e9..61401e0e 100644 --- a/src/util/PaperScript.js +++ b/src/util/PaperScript.js @@ -127,6 +127,9 @@ var PaperScript = new function() { } }); } + // Automatically redraw document at the end. + if (paper.document) + paper.document.redraw(); return res; } }