Merge pull request #1077 from sapics/fix-leak

Fix variable leak
This commit is contained in:
Jürg Lehni 2016-06-14 12:42:55 +02:00 committed by GitHub
commit 2551027d17
5 changed files with 6 additions and 6 deletions

View file

@ -318,7 +318,7 @@ Base.exports.PaperScript = (function() {
agent.firefox && version >= 40 || agent.firefox && version >= 40 ||
agent.node); agent.node);
var mappings = ['AA' + encodeVLQ(offsetCode ? 0 : offset) + 'A']; var mappings = ['AA' + encodeVLQ(offsetCode ? 0 : offset) + 'A'];
// Create empty entries by the amount of lines + 1, so join can be // Create empty entries by the amount of lines + 1, so join can be
// used below to produce the actual instructions that many times. // used below to produce the actual instructions that many times.
mappings.length = (code.match(lineBreaks) || []).length + 1 mappings.length = (code.match(lineBreaks) || []).length + 1
+ (offsetCode ? offset : 0); + (offsetCode ? offset : 0);

View file

@ -4106,7 +4106,7 @@ new function() { // Injection scope for hit-test functions shared with project
// Transform the blur value as a vector and use its new length: // Transform the blur value as a vector and use its new length:
blur = mx.transform(new Point(style.getShadowBlur(), 0)), blur = mx.transform(new Point(style.getShadowBlur(), 0)),
offset = mx.transform(this.getShadowOffset()); offset = mx.transform(this.getShadowOffset());
ctx.shadowColor = style.getShadowColor().toCanvasStyle(ctx); ctx.shadowColor = style.getShadowColor().toCanvasStyle(ctx);
ctx.shadowBlur = blur.getLength(); ctx.shadowBlur = blur.getLength();
ctx.shadowOffsetX = offset.x; ctx.shadowOffsetX = offset.x;
ctx.shadowOffsetY = offset.y; ctx.shadowOffsetY = offset.y;

View file

@ -95,7 +95,7 @@ module.exports = function(paper) {
frameDuration = 1 / options.fps, frameDuration = 1 / options.fps,
startTime = Date.now(), startTime = Date.now(),
lastTime = startTime, lastTime = startTime,
padding = options.padding || ((options.amount - 1) + '').length; padding = options.padding || ((options.amount - 1) + '').length,
paddedStr = Array(padding + 1).join('0'); paddedStr = Array(padding + 1).join('0');
// Start exporting frames by exporting the first frame: // Start exporting frames by exporting the first frame:

View file

@ -148,8 +148,8 @@ var PathFitter = Base.extend({
alpha1, alpha2; alpha1, alpha2;
if (abs(detC0C1) > epsilon) { if (abs(detC0C1) > epsilon) {
// Kramer's rule // Kramer's rule
var detC0X = C[0][0] * X[1] - C[1][0] * X[0], var detC0X = C[0][0] * X[1] - C[1][0] * X[0],
detXC1 = X[0] * C[1][1] - X[1] * C[0][1]; detXC1 = X[0] * C[1][1] - X[1] * C[0][1];
// Derive alpha values // Derive alpha values
alpha1 = detXC1 / detC0C1; alpha1 = detXC1 / detC0C1;
alpha2 = detC0X / detC0C1; alpha2 = detC0X / detC0C1;

View file

@ -655,7 +655,7 @@ var Segment = Base.extend(/** @lends Segment# */{
// If change is true, we need to set the new values back // If change is true, we need to set the new values back
point._x = x; point._x = x;
point._y = y; point._y = y;
i = 2; i = 2;
if (handleIn) { if (handleIn) {
handleIn._x = coords[i++] - x; handleIn._x = coords[i++] - x;
handleIn._y = coords[i++] - y; handleIn._y = coords[i++] - y;