Skip to content

Commit

Permalink
fix(): Use path instance context for exporting the path svg (#10276)
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur authored Nov 15, 2024
1 parent 61fc46f commit 335284c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [5.4.2]

- fix() Use correct Path context when creating the svg for the path [`#10276`](https://github.com/fabricjs/fabric.js/pull/10276)

## [5.4.1]

- fix() Fix the svg export of text with path [`#10268`](https://github.com/fabricjs/fabric.js/pull/10268)
Expand Down
12 changes: 7 additions & 5 deletions src/mixins/itext.svg_export.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@
*/
toSVG: function(reviver) {
var textSvg = this._createBaseSVGMarkup(
this._toSVG(),
{ reviver: reviver, noStyle: true, withShadow: true }
);
if (this.path) {
this._toSVG(),
{ reviver: reviver, noStyle: true, withShadow: true }
),
path = this.path;

if (path) {
return (
textSvg +
this._createBaseSVGMarkup(this.path._toSVG(), {
path._createBaseSVGMarkup(path._toSVG(), {
reviver: reviver,
withShadow: true,
})
Expand Down

0 comments on commit 335284c

Please sign in to comment.