Skip to content

Commit b711147

Browse files
committed
Recalcurate line-height when changing the font-family
1 parent c6a9591 commit b711147

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

app/editor/core/tblockshape.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,19 @@ thin.core.TblockShape.prototype.setTextLineHeightRatio = function(ratio) {
655655
};
656656

657657

658+
/**
659+
* @param {string} family
660+
*/
661+
thin.core.TblockShape.prototype.setFontFamily = function (family) {
662+
goog.base(this, 'setFontFamily', family);
663+
664+
var ratio = this.getTextLineHeightRatio();
665+
if (!thin.isExactlyEqual(ratio, thin.core.TextStyle.DEFAULT_LINEHEIGHT)) {
666+
this.setTextLineHeightRatio(ratio);
667+
}
668+
};
669+
670+
658671
/**
659672
* @param {number} size
660673
*/

0 commit comments

Comments
 (0)