Skip to content

Commit

Permalink
ptt - remove scale icons option
Browse files Browse the repository at this point in the history
  • Loading branch information
Jodi Giordano committed Oct 23, 2024
1 parent 35fe968 commit 53fd7ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
3 changes: 0 additions & 3 deletions app/src/pixi-tagged-text/TaggedText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const DEBUG = {
const DEFAULT_OPTIONS: TaggedTextOptions = {
debug: false,
imgMap: {},
scaleIcons: true,
skipUpdates: false,
skipDraw: false,
drawWhitespace: false,
Expand Down Expand Up @@ -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.
Expand All @@ -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,
);

Expand Down
16 changes: 7 additions & 9 deletions app/src/pixi-tagged-text/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 53fd7ca

Please sign in to comment.