mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
fix: setting null for a font style on a theme (#5831)
This commit is contained in:
@@ -622,18 +622,17 @@ ConstantProvider.prototype.setDynamicProperties_ = function(theme) {
|
||||
* @protected
|
||||
*/
|
||||
ConstantProvider.prototype.setFontConstants_ = function(theme) {
|
||||
this.FIELD_TEXT_FONTFAMILY =
|
||||
theme.fontStyle && theme.fontStyle['family'] !== undefined ?
|
||||
theme.fontStyle['family'] :
|
||||
this.FIELD_TEXT_FONTFAMILY;
|
||||
this.FIELD_TEXT_FONTWEIGHT =
|
||||
theme.fontStyle && theme.fontStyle['weight'] !== undefined ?
|
||||
theme.fontStyle['weight'] :
|
||||
this.FIELD_TEXT_FONTWEIGHT;
|
||||
this.FIELD_TEXT_FONTSIZE =
|
||||
theme.fontStyle && theme.fontStyle['size'] !== undefined ?
|
||||
theme.fontStyle['size'] :
|
||||
this.FIELD_TEXT_FONTSIZE;
|
||||
if (theme.fontStyle && theme.fontStyle['family']) {
|
||||
this.FIELD_TEXT_FONTFAMILY = theme.fontStyle['family'];
|
||||
}
|
||||
|
||||
if (theme.fontStyle && theme.fontStyle['weight']) {
|
||||
this.FIELD_TEXT_FONTWEIGHT = theme.fontStyle['weight'];
|
||||
}
|
||||
|
||||
if (theme.fontStyle && theme.fontStyle['size']) {
|
||||
this.FIELD_TEXT_FONTSIZE = theme.fontStyle['size'];
|
||||
}
|
||||
|
||||
const fontMetrics = dom.measureFontMetrics(
|
||||
'Hg', this.FIELD_TEXT_FONTSIZE + 'pt', this.FIELD_TEXT_FONTWEIGHT,
|
||||
|
||||
Reference in New Issue
Block a user