Skip to content

Commit

Permalink
handle non-object fonts in textProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
dhowe committed Dec 29, 2024
1 parent 41d9c3b commit d49cab8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/type/text2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,12 @@ function text2d(p5, fn) {
else { // a renderer.states property
if (p === 'textFont') {
// avoid circular ref. inside textFont
properties[p] = Object.assign({}, this._currentTextFont());
delete properties[p]._pInst;
let current = this._currentTextFont();
if (typeof current === 'object' && '_pInst' in current) {
current = Object.assign({}, current);
delete current._pInst;
}
properties[p] = current;
}
else {
properties[p] = this.states[p];
Expand Down

0 comments on commit d49cab8

Please sign in to comment.