From 46bd6c9b3f744edb3ca04a86f64405f1708dbe85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 12 Mar 2014 10:51:09 +0100 Subject: [PATCH] WineGum example: Untangle the offset calculation code a bit. --- examples/Animated/WineGums.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/Animated/WineGums.html b/examples/Animated/WineGums.html index da9f9ac7..88d5a7cb 100644 --- a/examples/Animated/WineGums.html +++ b/examples/Animated/WineGums.html @@ -68,8 +68,10 @@ this.boundOffset[i] = this.radius / 4; var next = (i + 1) % this.numSegment; var prev = (i > 0) ? i - 1 : this.numSegment - 1; - this.boundOffsetBuff[i] = this.boundOffset[i] += (this.radius - this.boundOffset[i]) / 15; - this.boundOffsetBuff[i] = this.boundOffset[i] += ((this.boundOffset[next] + this.boundOffset[prev]) / 2 - this.boundOffset[i]) / 3; + var offset = this.boundOffset[i]; + offset += (this.radius - offset) / 15; + offset += ((this.boundOffset[next] + this.boundOffset[prev]) / 2 - offset) / 3; + this.boundOffsetBuff[i] = this.boundOffset[i] = offset; } },