Merge pull request #495 from Tyriar/494_display_none_resize_fix

Only keep > 0 geometry in CharMeasure
This commit is contained in:
Daniel Imms
2017-01-20 07:26:46 -08:00
committed by GitHub
+5 -3
View File
@@ -44,10 +44,12 @@ export class CharMeasure extends EventEmitter {
}
private _doMeasure(): void {
const oldWidth = this._width;
const oldHeight = this._height;
const geometry = this._measureElement.getBoundingClientRect();
// The element is likely currently display:none, we should retain the
// previous value.
if (geometry.width === 0 || geometry.height === 0) {
return;
}
if (this._width !== geometry.width || this._height !== geometry.height) {
this._width = geometry.width;
this._height = geometry.height;