Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Bump node version requirement to 20+
- Bump minimum supported browsers to Firefox 115, iOS/Safari 16
- Fix text with input x as null

### [v0.18.0] - 2026-03-14

Expand Down
4 changes: 2 additions & 2 deletions lib/mixins/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ export default {
},

_initOptions(x = {}, y, options = {}) {
if (typeof x === 'object') {
if (x && typeof x === 'object') {
options = x;
x = null;
Comment on lines 391 to 394
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot add a unit test

}
Expand Down Expand Up @@ -433,7 +433,7 @@ export default {
} // 1/4 inch

// Normalize rotation to between 0 - 360
result.rotation = Number(options.rotation ?? 0) % 360;
result.rotation = Number(result.rotation ?? 0) % 360;
if (result.rotation < 0) result.rotation += 360;

return result;
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/text.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@ Q

expect(docData).toContainText({ text });
});

test('with null x coordinate', () => {
const docData = logData(document);

document.text('text with null x', null, 50);
document.end();

expect(docData).toContainText({ text: 'text with null x' });
});
});

describe('text with structure parent links', () => {
Expand Down
Loading