Prevent charsizechanged from firing unnecessarily

This commit is contained in:
Juan Campa
2019-01-15 11:00:34 -05:00
parent 509ce5fa3a
commit e02a9ff09e
+3 -2
View File
@@ -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');
}
}