Skip to content

Updated TextGeometry to use ES6 class format.#49

Open
jmschrack wants to merge 1 commit into
Experience-Monks:masterfrom
jmschrack:es6class
Open

Updated TextGeometry to use ES6 class format.#49
jmschrack wants to merge 1 commit into
Experience-Monks:masterfrom
jmschrack:es6class

Conversation

@jmschrack
Copy link
Copy Markdown

What kind of change does this PR introduce? (check at least one)

  • Bugfix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Code style update
  • Refactor (refactoring or adding test which isn't a fix or add a feature)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Did you test your solution?

  • I lightly tested it in one browser
  • I deeply tested it in several browsers
  • I wrote tests around it (unit tests, integration tests, E2E tests)

I tested all the provided samples in Edge, Chrome, and Firefox. They all worked fine. 👍

Problem Description

Three-bmfont-text is incompatible with ES6 classes.
See: #46

Solution Description

var Base = THREE.BufferGeometry
function TextGeometry (opt) {
  Base.call(this)
...
}
inherits(TextGeometry, Base);

was changed to

class TextGeometry extends THREE.BufferGeometry {
  constructor(opt){
    super(opt);
...
  }
}

Side Effects, Risks, Impact

  • N/A

Aditional comments:

@jtbandes
Copy link
Copy Markdown

@mattdesl would you be able to review this PR? Looks like #46 prevents use with versions of three.js that internally use ES6 classes.

@kkota1
Copy link
Copy Markdown

kkota1 commented Aug 18, 2022

Did the owner die or something. Good PR

@jtbandes
Copy link
Copy Markdown

jtbandes commented Aug 19, 2022

I ended up making a separate package for text rendering. Check it out at: https://github.com/foxglove/three-text Will publish to NPM shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants