From e02a9ff09e8026399f84a0eb41b427f7a4c13234 Mon Sep 17 00:00:00 2001 From: Juan Campa Date: Tue, 15 Jan 2019 11:00:34 -0500 Subject: [PATCH] Prevent charsizechanged from firing unnecessarily --- src/ui/CharMeasure.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ui/CharMeasure.ts b/src/ui/CharMeasure.ts index 2dfc4eb561..0ac755eab8 100644 --- a/src/ui/CharMeasure.ts +++ b/src/ui/CharMeasure.ts @@ -46,9 +46,10 @@ export class CharMeasure extends EventEmitter implements ICharMeasure { if (geometry.width === 0 || geometry.height === 0) { return; } - if (this._width !== geometry.width || this._height !== geometry.height) { + const adjustedHeight = Math.ceil(geometry.height); + if (this._width !== geometry.width || this._height !== adjustedHeight) { this._width = geometry.width; - this._height = Math.ceil(geometry.height); + this._height = adjustedHeight; this.emit('charsizechanged'); } }