nartc / angular-three

🧊 THREE.js integration for Angular 🧊
https://angular-three.netlify.app/
MIT License
306 stars 26 forks source link

Bug - Soba Text whiteSpace #155

Open IRobot1 opened 1 year ago

IRobot1 commented 1 year ago

Current code looks like this

  @Input() set whiteSpace(whiteSpace: 'normal' | 'overflowWrap' | 'overflowWrap') {
    this.set({ whiteSpace });
  }

According to the troika-three-text code.

      /**
       * @member {string} whiteSpace
       * Defines whether text should wrap when a line reaches the `maxWidth`. Can
       * be either `'normal'` (the default), to allow wrapping according to the `overflowWrap` property,
       * or `'nowrap'` to prevent wrapping. Note that `'normal'` here honors newline characters to
       * manually break lines, making it behave more like `'pre-wrap'` does in CSS.
       */
      this.whiteSpace = 'normal'

Code should look like this

  @Input() set whiteSpace(whiteSpace: 'normal' | 'nowrap') {
    this.set({ whiteSpace });
  }

overflowWrap should be a separate property...

      /**
       * @member {string} overflowWrap
       * Defines how text wraps if the `whiteSpace` property is `normal`. Can be either `'normal'`
       * to break at whitespace characters, or `'break-word'` to allow breaking within words.
       * Defaults to `'normal'`.
       */
      this.overflowWrap = 'normal'