sdfsdfs
This commit is contained in:
28
node_modules/pixi.js/lib/scene/text/Text.mjs
generated
vendored
Normal file
28
node_modules/pixi.js/lib/scene/text/Text.mjs
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { AbstractText, ensureOptions } from './AbstractText.mjs';
|
||||
import { CanvasTextMetrics } from './canvas/CanvasTextMetrics.mjs';
|
||||
import { TextStyle } from './TextStyle.mjs';
|
||||
|
||||
"use strict";
|
||||
class Text extends AbstractText {
|
||||
constructor(...args) {
|
||||
const options = ensureOptions(args, "Text");
|
||||
super(options, TextStyle);
|
||||
this.renderPipeId = "text";
|
||||
}
|
||||
_updateBounds() {
|
||||
const bounds = this._bounds;
|
||||
const anchor = this._anchor;
|
||||
const canvasMeasurement = CanvasTextMetrics.measureText(
|
||||
this._text,
|
||||
this._style
|
||||
);
|
||||
const { width, height } = canvasMeasurement;
|
||||
bounds.minX = -anchor._x * width;
|
||||
bounds.maxX = bounds.minX + width;
|
||||
bounds.minY = -anchor._y * height;
|
||||
bounds.maxY = bounds.minY + height;
|
||||
}
|
||||
}
|
||||
|
||||
export { Text };
|
||||
//# sourceMappingURL=Text.mjs.map
|
Reference in New Issue
Block a user