Skip to content

Commit

Permalink
Fix GH#22531: SVG Export: Write width and height in mm, not px
Browse files Browse the repository at this point in the history
Backport of musescore#24029
  • Loading branch information
bakajikara authored and Jojo-Schmitz committed Aug 14, 2024
1 parent ab3ff13 commit b940f96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mscore/svggenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class SvgPaintEngine : public QPaintEngine
#define SVG_QUOTE "\""
#define SVG_COMMA ","
#define SVG_GT ">"
#define SVG_PX "px"
#define SVG_MM "mm"
#define SVG_NONE "none"
#define SVG_EVENODD "evenodd"
#define SVG_BUTT "butt"
Expand Down Expand Up @@ -1033,8 +1033,8 @@ bool SvgPaintEngine::begin(QPaintDevice *)
stream() << "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" << endl << SVG_BEGIN;
if (d->viewBox.isValid()) {
// viewBox has floating point values, size width/height is integer
stream() << SVG_WIDTH << d->viewBox.width() << SVG_PX << SVG_QUOTE
<< SVG_HEIGHT << d->viewBox.height() << SVG_PX << SVG_QUOTE;
stream() << SVG_WIDTH << d->viewBox.width() / Ms::DPMM << SVG_MM << SVG_QUOTE
<< SVG_HEIGHT << d->viewBox.height() / Ms::DPMM << SVG_MM << SVG_QUOTE;

stream() << SVG_VIEW_BOX << d->viewBox.left()
<< SVG_SPACE << d->viewBox.top()
Expand Down

0 comments on commit b940f96

Please sign in to comment.