mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Support units other than 'px' in CharacterStyle#fontSize, but default to 'px' if no unit is specified.
This commit is contained in:
parent
701c5fd9e7
commit
8bdcbe1777
1 changed files with 2 additions and 1 deletions
|
@ -78,6 +78,7 @@ var CharacterStyle = this.CharacterStyle = PathStyle.extend(/** @lends Character
|
|||
},
|
||||
|
||||
getFontStyle: function() {
|
||||
return this._fontSize + 'px ' + this._font;
|
||||
var size = this._fontSize;
|
||||
return (/[a-z]/i.test(size) ? size + ' ' : size + 'px ') + this._font;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue