Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bigtimebuddy committed Dec 2, 2022
1 parent ca7b6ef commit f557726
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/HTMLText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class HTMLText extends Sprite

/** The maximum width in rendered pixels that the content can be, any larger will be hidden */
public maxWidth: number;

/** The maximum height in rendered pixels that the content can be, any larger will be hidden */
public maxHeight: number;

Expand Down Expand Up @@ -98,6 +98,7 @@ export class HTMLText extends Sprite
this._autoResolution = HTMLText.defaultAutoResolution;

const shadowRoot = shadow.attachShadow({ mode: 'open' });

shadowRoot.appendChild(svgRoot);
shadow.dataset.pixiId = '@pixi/text-html';
Object.assign(shadow.style, {
Expand Down Expand Up @@ -144,7 +145,7 @@ export class HTMLText extends Sprite
});
this._styleElement.innerHTML = style.toGlobalCSS();

// Measure the contents using the shadow DOM
// Measure the contents using the shadow DOM
const contentBounds = this._domElement.getBoundingClientRect();

const width = Math.min(this.maxWidth, Math.ceil(contentBounds.width));
Expand Down

0 comments on commit f557726

Please sign in to comment.