Skip to content

Commit

Permalink
fix: transform controls has wrong reference to this in defineProperty…
Browse files Browse the repository at this point in the history
… funciton
  • Loading branch information
joshuaellis committed Mar 19, 2021
1 parent 7080889 commit 37b3de8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/controls/TransformControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class TransformControls extends Object3D {
}

// Defined getter, setter and store for a property
function defineProperty<TValue>(propName: string, defaultValue: TValue): void {
const defineProperty = <TValue>(propName: string, defaultValue: TValue): void => {
Object.defineProperty(this, propName, {
get: function () {
return this[propName]
Expand All @@ -169,8 +169,9 @@ class TransformControls extends Object3D {
}
},
})

// @ts-ignore
this._plane[propName] = defaultValue
// @ts-ignore
this._gizmo[propName] = defaultValue
}
}
Expand Down

0 comments on commit 37b3de8

Please sign in to comment.