Skip to content

Commit fd8a9ec

Browse files
authored
Merge pull request #72 from thinreports/fix_line_height_isnot_recalcurated_when_changing_font_family
The line-height of a text-block is not recalculated when changing font-size
2 parents c6a9591 + 3cbc1ce commit fd8a9ec

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Bugfixes
44

55
* Fixed: the line-height property returns different calculation results depending on environment (#71)
6+
* Fixed: the line-height of a text-block is not recalculated when changing font-size (#72)
67

78
## 0.10.0
89

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)