Skip to content

Commit

Permalink
Fix: Fix svgParser bug and remove some extra code (#677)
Browse files Browse the repository at this point in the history
  • Loading branch information
jane-rose authored Jan 5, 2021
1 parent 63c3fd9 commit 57844e4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
12 changes: 0 additions & 12 deletions src/app/components/SMCanvas/TransformControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,6 @@ class TransformControls extends Object3D {
this.destroyDefaults();
}

calculateScalePosition(originalPosition, centerPosition, eVec) {
const positionX = centerPosition.x + (originalPosition.x - centerPosition.x) * eVec.x;
const positionY = centerPosition.y + (originalPosition.y - centerPosition.y) * eVec.y;
const positionZ = centerPosition.z + (originalPosition.z - centerPosition.z) * eVec.z;
return {
x: positionX,
y: positionY,
z: positionZ
};
}


createPeripheral(definitions) {
const peripheral = new Object3D();

Expand Down
4 changes: 0 additions & 4 deletions src/app/models/ModelGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class ModelGroup extends EventEmitter {
this.headType = headType;
// this.object = new Object3D();
this.object = new Group();
this.showObject = new Group();

this.models = [];

Expand Down Expand Up @@ -388,9 +387,6 @@ class ModelGroup extends EventEmitter {
}
}

addHiddenMeshObjects() {
this.showObject.children.splice(0);
}

setConvexGeometry(uploadName, convexGeometry) {
const models = this.models.filter(m => m.uploadName === uploadName);
Expand Down
4 changes: 2 additions & 2 deletions src/shared/lib/SVGParser/AttributesParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,13 @@ class AttributesParser {
}
// make a copy of parentAttributes
attributes.xform = [1, 0, 0, 1, 0, 0];
// Regardless of whether 'node.$' is exited, 'xform' in 'attributes' must be applied to 'node' element
xformMultiply(attributes.xform, parentAttributes.xform);

if (!node.$) {
return attributes;
}

xformMultiply(attributes.xform, parentAttributes.xform);

Object.keys(node.$).forEach((key) => {
const value = node.$[key];
this.parseAttribute(attributes, parentAttributes, key, value);
Expand Down

0 comments on commit 57844e4

Please sign in to comment.