From 53fd7ca1452ded7d2d38974ed6ce2ba1a96ea812 Mon Sep 17 00:00:00 2001 From: Jodi Giordano Date: Wed, 23 Oct 2024 09:24:49 -0400 Subject: [PATCH] ptt - remove scale icons option --- app/src/pixi-tagged-text/TaggedText.ts | 3 --- app/src/pixi-tagged-text/layout.ts | 16 +++++++--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/app/src/pixi-tagged-text/TaggedText.ts b/app/src/pixi-tagged-text/TaggedText.ts index d99ee17..b7f6b51 100644 --- a/app/src/pixi-tagged-text/TaggedText.ts +++ b/app/src/pixi-tagged-text/TaggedText.ts @@ -61,7 +61,6 @@ const DEBUG = { const DEFAULT_OPTIONS: TaggedTextOptions = { debug: false, imgMap: {}, - scaleIcons: true, skipUpdates: false, skipDraw: false, drawWhitespace: false, @@ -443,7 +442,6 @@ export default class TaggedText extends Sprite { public update(skipDraw?: boolean): ParagraphToken { // Determine default style properties const tagStyles = this.tagStyles; - const { scaleIcons } = this.options; const spriteTemplates = this.options.imgMap && this.spriteTemplates; // Pre-process text. @@ -460,7 +458,6 @@ export default class TaggedText extends Sprite { // Create the text segments, position and add them. (draw) const newFinalTokens = calculateTokens( styledTokens, - scaleIcons, this.options.adjustFontBaseline, ); diff --git a/app/src/pixi-tagged-text/layout.ts b/app/src/pixi-tagged-text/layout.ts index 2281d56..5fac707 100644 --- a/app/src/pixi-tagged-text/layout.ts +++ b/app/src/pixi-tagged-text/layout.ts @@ -605,7 +605,6 @@ export const splitText = (s: string): string[] => { export const calculateTokens = ( styledTokens: StyledTokens, - scaleIcons = true, adjustFontBaseline?: FontMap, ): ParagraphToken => { // Create a text field to use for measurements. @@ -723,14 +722,13 @@ export const calculateTokens = ( sprite.scale.set(ratio); } - if (scaleIcons) { - const { - fontScaleWidth: scaleX = 1.0, - fontScaleHeight: scaleY = 1.0, - } = style; - sprite.scale.x *= scaleX; - sprite.scale.y *= scaleY; - } + const { + fontScaleWidth: scaleX = 1.0, + fontScaleHeight: scaleY = 1.0, + } = style; + + sprite.scale.x *= scaleX; + sprite.scale.y *= scaleY; } // handle images