Skip to content

Commit

Permalink
fix(GlyphsGeometry): move prototype fallback to class
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett committed Nov 15, 2022
1 parent fc4e549 commit b55a0c8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/troika-three-text/src/GlyphsGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ class GlyphsGeometry extends InstancedBufferGeometry {
this.boundingBox = new Box3()
}

// Compat for pre r109:
setAttribute(name, attribute) {
if (super.setAttribute) return super.setAttribute(name, attribute)

this.attributes[ name ] = attribute
return this
}

computeBoundingSphere () {
// No-op; we'll sync the boundingSphere proactively when needed.
}
Expand Down Expand Up @@ -217,14 +225,6 @@ class GlyphsGeometry extends InstancedBufferGeometry {
}
}

// Compat for pre r109:
if (!GlyphsGeometry.prototype.setAttribute) {
GlyphsGeometry.prototype.setAttribute = function(name, attribute) {
this.attributes[ name ] = attribute
return this
}
}


function updateBufferAttr(geom, attrName, newArray, itemSize) {
const attr = geom.getAttribute(attrName)
Expand Down

0 comments on commit b55a0c8

Please sign in to comment.