message: Fix roundPixel bug with BitmapText
diff: @@ -66,7 +66,6 @@ export class BitmapText extends Container
  maxWidth: 0,
  letterSpacing: 0,
  };
  - public roundPixels: boolean;
  public dirty: boolean;
  protected _textWidth: number;
  protected _textHeight: number;
  @@ -80,6 +79,7 @@ export class BitmapText extends Container
  protected _align: TextStyleAlign;
  protected _activePagesMeshData: PageMeshData[];
  protected _tint = 0xFFFFFF;
  + protected _roundPixels: boolean;
  /**
  * @param {string} text - A string that you would like the text to display.
  @@ -214,15 +214,12 @@ export class BitmapText extends Container
  this._anchor = new ObservablePoint((): void => { this.dirty = true; }, this, 0, 0);
  /**
  - * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
  - * Advantages can include sharper image quality (like text) and faster rendering on canvas.
  - * The main disadvantage is movement of objects may appear less smooth.
  - * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
  + * If true PixiJS will Math.floor() x/y values when rendering
  *
  * @member {boolean}
  * @default PIXI.settings.ROUND_PIXELS
  */
  - this.roundPixels = settings.ROUND_PIXELS;
  + this._roundPixels = settings.ROUND_PIXELS;
  /**
  * Set to `true` if the BitmapText needs to be redrawn.
  @@ -476,7 +473,14 @@ export class BitmapText extends Container
  for (let i = 0; i < lenChars; i++)
  {
  const char = chars[i];
  - const xPos = (char.position.x + lineAlignOffsets[char.line]) * scale;
  + let offset = char.position.x + lineAlignOffsets[char.line];
  +
  + if (this._roundPixels)
  + {
  + offset = Math.round(offset);
  + }
  +
  + const xPos = offset * scale;
  const yPos = char.position.y * scale;
  const texture = char.texture;
  @@ -813,6 +817,29 @@ export class BitmapText extends Container
  }
  }
  + /**
  + * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
  + * Advantages can include sharper image quality (like text) and faster rendering on canvas.
  + * The main disadvantage is movement of objects may appear less smooth.
  + * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
  + *
  + * @member {boolean}
  + * @default PIXI.settings.ROUND_PIXELS
  + */
  + public get roundPixels(): boolean
  + {
  + return this._roundPixels;
  + }
  +
  + public set roundPixels(value: boolean)
  + {
  + if (value !== this._roundPixels)
  + {
  + this._roundPixels = value;
  + this.dirty = true;
  + }
  + }
  +
  /**
  * The height of the overall text, different from fontSize,
  * which is defined in the style object.
  