Skip to content

Commit

Permalink
Prevent charsizechanged from firing unnecessarily
Browse files Browse the repository at this point in the history
  • Loading branch information
juancampa committed Jan 15, 2019
1 parent 509ce5f commit e02a9ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ui/CharMeasure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
Expand Down

0 comments on commit e02a9ff

Please sign in to comment.