Skip to content

Commit b50b392

Browse files
truman126chearon
authored andcommitted
added a check to make sure maxWidth > 0
Fixes #2171
1 parent 494035d commit b50b392

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
1313
### Fixed
1414
* Fix a crash when SVGs without width or height are loaded (#2486)
1515
* Fix fetching prebuilds during installation on certain newer versions of Node (#2497)
16+
* Fixed issue with fillText that was breaking subsequent fillText calls (#2171)
1617

1718
3.1.0
1819
==================

src/CanvasRenderingContext2d.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,6 +2496,7 @@ Context2d::paintText(const Napi::CallbackInfo& info, bool stroke) {
24962496
pango_context_set_base_dir(pango_layout_get_context(_layout), pango_dir);
24972497

24982498
if (argsNum == 3) {
2499+
if (args[2] <= 0) return;
24992500
scaled_by = get_text_scale(layout, args[2]);
25002501
cairo_save(context());
25012502
cairo_scale(context(), scaled_by, 1);

0 commit comments

Comments
 (0)