Skip to content

Commit 77b923c

Browse files
committed
Fix cloning bug.
1 parent 79d4f9d commit 77b923c

File tree

10 files changed

+94
-98
lines changed

10 files changed

+94
-98
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ Bezier Curve
334334

335335
Bezier Surface
336336
```javascript
337-
.beziersurface({
337+
.bezierSurface({
338338
n: [ 64, 64 ], // Number of points in each direction
339339
domain: [[0, 1], [0, 1]], // X/Y Domain in interpolation space
340340
data: null, // Array of control points, each an array of 2 or 3 elements

build/MathBox-bundle.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43527,15 +43527,15 @@ MathBox.Stage.prototype = _.extend(MathBox.Stage.prototype, {
4352743527
delete original.sequence;
4352843528

4352943529
// Sort options into animatable and non-animatable
43530-
options = _.extend({}, options);
43530+
var newOptions = _.extend({}, options);
4353143531
var remove = [];
4353243532
_.each(options, function (value, key) {
4353343533
if (key == 'id' || typeof value == 'boolean' || value === null) {
4353443534
original[key] = options[key];
4353543535
remove.push(key);
4353643536
}
4353743537
});
43538-
_.each(remove, function (key) { delete options[key] });
43538+
_.each(remove, function (key) { delete newOptions[key] });
4353943539

4354043540
// Force ID change
4354143541
if (original.id == primitive.get('id')) {
@@ -43544,7 +43544,7 @@ MathBox.Stage.prototype = _.extend(MathBox.Stage.prototype, {
4354443544

4354543545
// Spawn clone and animate it to new properties
4354643546
var copy = this.spawn(primitive.type(), original, { duration: 0 });
43547-
this.animate(copy, options, animate);
43547+
this.animate(copy, newOptions, animate);
4354843548
}.bind(this));
4354943549

4355043550
return this;
@@ -44474,7 +44474,7 @@ MathBox.CameraProxy = function (world, options) {
4447444474
orbit: options.orbit || 3.5,
4447544475
phi: options.phi || τ/4,
4447644476
theta: options.theta || 0,
44477-
lookAt: [0, 0, 0],
44477+
lookAt: options.lookAt || [0, 0, 0],
4447844478
});
4447944479

4448044480
this.singleton = 'camera';
@@ -45738,7 +45738,6 @@ MathBox.BezierSurface.prototype = _.extend(new MathBox.Surface(null), {
4573845738
doubleSided: true,
4573945739
flipSided: false,
4574045740
shaded: true,
45741-
map: null,
4574245741
style: {}//,
4574345742
};
4574445743
},
@@ -45772,7 +45771,7 @@ MathBox.BezierSurface.prototype = _.extend(new MathBox.Surface(null), {
4577245771
_.loop(order + 1, function (i) {
4577345772
if (data && (data[j] !== undefined) && (data[j][i] !== undefined)) {
4577445773
// Use data if available
45775-
p = data[i];
45774+
p = data[j][i];
4577645775
}
4577745776
else {
4577845777
// Use expression.

build/MathBox-bundle.min.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/MathBox-core.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -930,15 +930,15 @@ MathBox.Stage.prototype = _.extend(MathBox.Stage.prototype, {
930930
delete original.sequence;
931931

932932
// Sort options into animatable and non-animatable
933-
options = _.extend({}, options);
933+
var newOptions = _.extend({}, options);
934934
var remove = [];
935935
_.each(options, function (value, key) {
936936
if (key == 'id' || typeof value == 'boolean' || value === null) {
937937
original[key] = options[key];
938938
remove.push(key);
939939
}
940940
});
941-
_.each(remove, function (key) { delete options[key] });
941+
_.each(remove, function (key) { delete newOptions[key] });
942942

943943
// Force ID change
944944
if (original.id == primitive.get('id')) {
@@ -947,7 +947,7 @@ MathBox.Stage.prototype = _.extend(MathBox.Stage.prototype, {
947947

948948
// Spawn clone and animate it to new properties
949949
var copy = this.spawn(primitive.type(), original, { duration: 0 });
950-
this.animate(copy, options, animate);
950+
this.animate(copy, newOptions, animate);
951951
}.bind(this));
952952

953953
return this;
@@ -1877,7 +1877,7 @@ MathBox.CameraProxy = function (world, options) {
18771877
orbit: options.orbit || 3.5,
18781878
phi: options.phi || τ/4,
18791879
theta: options.theta || 0,
1880-
lookAt: [0, 0, 0],
1880+
lookAt: options.lookAt || [0, 0, 0],
18811881
});
18821882

18831883
this.singleton = 'camera';
@@ -3141,7 +3141,6 @@ MathBox.BezierSurface.prototype = _.extend(new MathBox.Surface(null), {
31413141
doubleSided: true,
31423142
flipSided: false,
31433143
shaded: true,
3144-
map: null,
31453144
style: {}//,
31463145
};
31473146
},
@@ -3175,7 +3174,7 @@ MathBox.BezierSurface.prototype = _.extend(new MathBox.Surface(null), {
31753174
_.loop(order + 1, function (i) {
31763175
if (data && (data[j] !== undefined) && (data[j][i] !== undefined)) {
31773176
// Use data if available
3178-
p = data[i];
3177+
p = data[j][i];
31793178
}
31803179
else {
31813180
// Use expression.

0 commit comments

Comments
 (0)