mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
fix: specify type Text.measureSize
This commit is contained in:
parent
7b99aa9813
commit
ffc58d248b
@ -392,13 +392,13 @@ export class Text extends Shape<TextConfig> {
|
|||||||
* That method can't handle multiline text.
|
* That method can't handle multiline text.
|
||||||
* @method
|
* @method
|
||||||
* @name Konva.Text#measureSize
|
* @name Konva.Text#measureSize
|
||||||
* @param {String} [text] text to measure
|
* @param {String} text text to measure
|
||||||
* @returns {Object} { width , height} of measured text
|
* @returns {Object} { width , height } of measured text
|
||||||
*/
|
*/
|
||||||
measureSize(text) {
|
measureSize(text: string) {
|
||||||
var _context = getDummyContext(),
|
var _context = getDummyContext(),
|
||||||
fontSize = this.fontSize(),
|
fontSize = this.fontSize(),
|
||||||
metrics;
|
metrics: TextMetrics;
|
||||||
|
|
||||||
_context.save();
|
_context.save();
|
||||||
_context.font = this._getContextFont();
|
_context.font = this._getContextFont();
|
||||||
|
Loading…
Reference in New Issue
Block a user