Skip to content

Commit

Permalink
Merge pull request #1052 from googlefonts/issue1014
Browse files Browse the repository at this point in the history
Don't error on setting advance width for empty glyph
  • Loading branch information
justvanrossum authored Jan 12, 2024
2 parents 9ef58c1 + 956f0e0 commit 0f8f930
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/fontra/client/web-components/ui-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ export class Form extends SimpleElement {
return Object.keys(this._fieldGetters);
}

hasKey(key) {
return key in this._fieldGetters;
}

getValue(key) {
const getter = this._fieldGetters[key];
if (getter === undefined) {
Expand Down
4 changes: 3 additions & 1 deletion src/fontra/views/editor/panel-selection-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ export default class SelectionInfoPanel extends Panel {
pointIndices,
componentIndices
);
this.infoForm.setValue("dimensions", dimensionsString);
if (this.infoForm.hasKey("dimensions")) {
this.infoForm.setValue("dimensions", dimensionsString);
}
}

_getSelection() {
Expand Down

0 comments on commit 0f8f930

Please sign in to comment.