Skip to content

Commit

Permalink
fix get font configs issue (#11653)
Browse files Browse the repository at this point in the history
The original logical will never get font configs from the `textStyle` option, and also the `ecModel` doesn't have other font configs except the `textStyle` option.
`var gTextStyleModel = ecModel || ecModel.getModel('textStyle');`
  • Loading branch information
code4fan authored and pissang committed Nov 18, 2019
1 parent cb006de commit bba490f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/util/graphic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1071,8 +1071,7 @@ function rollbackDefaultTextStyle(style) {
}

export function getFont(opt, ecModel) {
// ecModel or default text style model.
var gTextStyleModel = ecModel || ecModel.getModel('textStyle');
var gTextStyleModel = ecModel && ecModel.getModel('textStyle');
return zrUtil.trim([
// FIXME in node-canvas fontWeight is before fontStyle
opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '',
Expand Down

0 comments on commit bba490f

Please sign in to comment.