From 5df30c4a7a1273d5659a8565dbbd3b0d80f05818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ju=CC=88rg=20Lehni?= Date: Sat, 7 Mar 2015 11:05:57 +0100 Subject: [PATCH] Clean up FutureSplash code a bit. --- examples/Paperjs.org/FutureSplash.html | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/Paperjs.org/FutureSplash.html b/examples/Paperjs.org/FutureSplash.html index 641f92e5..8dbcc049 100644 --- a/examples/Paperjs.org/FutureSplash.html +++ b/examples/Paperjs.org/FutureSplash.html @@ -80,14 +80,12 @@ if (!point.fixed && location.distance < size.height / 4) { var y = event.point.y; point.y += (y - point.y) / 6; - if (segment.previous && !segment.previous.point.fixed) { - var previous = segment.previous.point; + var previous = segment.previous && segment.previous.point; + var next = segment.next && segment.next.point; + if (previous && !previous.fixed) previous.y += (y - previous.y) / 24; - } - if (segment.next && !segment.next.point.fixed) { - var next = segment.next.point; + if (next && !next.fixed) next.y += (y - next.y) / 24; - } } }