fixed font size flicker between show/hide of editor instances
This commit is contained in:
parent
3103915b0a
commit
0caee61b22
3 changed files with 12 additions and 1 deletions
|
|
@ -11975,6 +11975,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
|
|
||||||
// full
|
// full
|
||||||
if (changes & this.CHANGE_FULL) {
|
if (changes & this.CHANGE_FULL) {
|
||||||
|
this.$textLayer.checkForSizeChanges();
|
||||||
this.$textLayer.update(this.layerConfig);
|
this.$textLayer.update(this.layerConfig);
|
||||||
if (this.showGutter)
|
if (this.showGutter)
|
||||||
this.$gutterLayer.update(this.layerConfig);
|
this.$gutterLayer.update(this.layerConfig);
|
||||||
|
|
@ -12950,6 +12951,11 @@ var Text = function(parentEl) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Size and width can be null if the editor is not visible or
|
||||||
|
// detached from the document
|
||||||
|
if (!this.element.offsetWidth)
|
||||||
|
return null;
|
||||||
|
|
||||||
var style = this.$measureNode.style;
|
var style = this.$measureNode.style;
|
||||||
var computedStyle = dom.computedStyle(this.element);
|
var computedStyle = dom.computedStyle(this.element);
|
||||||
for (var prop in this.$fontStyles)
|
for (var prop in this.$fontStyles)
|
||||||
|
|
@ -12964,7 +12970,6 @@ var Text = function(parentEl) {
|
||||||
// detached from the document
|
// detached from the document
|
||||||
if (size.width == 0 && size.height == 0)
|
if (size.width == 0 && size.height == 0)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,11 @@ var Text = function(parentEl) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Size and width can be null if the editor is not visible or
|
||||||
|
// detached from the document
|
||||||
|
if (!this.element.offsetWidth)
|
||||||
|
return null;
|
||||||
|
|
||||||
var style = this.$measureNode.style;
|
var style = this.$measureNode.style;
|
||||||
var computedStyle = dom.computedStyle(this.element);
|
var computedStyle = dom.computedStyle(this.element);
|
||||||
for (var prop in this.$fontStyles)
|
for (var prop in this.$fontStyles)
|
||||||
|
|
|
||||||
|
|
@ -423,6 +423,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
|
|
||||||
// full
|
// full
|
||||||
if (changes & this.CHANGE_FULL) {
|
if (changes & this.CHANGE_FULL) {
|
||||||
|
this.$textLayer.checkForSizeChanges();
|
||||||
this.$textLayer.update(this.layerConfig);
|
this.$textLayer.update(this.layerConfig);
|
||||||
if (this.showGutter)
|
if (this.showGutter)
|
||||||
this.$gutterLayer.update(this.layerConfig);
|
this.$gutterLayer.update(this.layerConfig);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue