Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(): Use path instance context for exporting the path svg #10276

Merged
merged 5 commits into from
Nov 15, 2024
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
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
Loading