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 conflicting bbox setting between pgfsys-dvisvgm and dvisvgm command; #1276

Merged
merged 2 commits into from
Oct 23, 2023
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
2 changes: 2 additions & 0 deletions doc/generic/pgf/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed

- Typo in animations `end on` key #1273
- Output bounding box adjustment in pgfsys-dvisvgm.def #1275

### Changed

Expand All @@ -25,6 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Qrrbrbirlbel
- quark67
- Yukai Chou (muzimuzhi)
- Alexander Grahn

## [3.1.10] - 2023-01-13 Henri Menke

Expand Down
4 changes: 4 additions & 0 deletions testfiles/pgf001.latexdvisvgm.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ TEST 1: pgf: \pgfpathmoveto
\hbox(0.0+0.0)x0.0, direction TLT
.\hbox(0.0+0.0)x0.0, direction TLT
..\special{dvisvgm:bbox 0.0 0.0}
..\special{dvisvgm:bbox lock}
..\hbox(0.0+0.0)x0.0, direction TLT
...\glue -28.45274
...\hbox(0.0+0.0)x0.0, shifted 28.45274, direction TLT
Expand All @@ -25,6 +26,7 @@ TEST 1: pgf: \pgfpathmoveto
....\special{dvisvgm:raw </g>}
....\special{color pop}
....\glue 0.0 plus 1.0fil minus 1.0fil
..\special{dvisvgm:bbox unlock}
! OK.
\ENDPGFTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
Expand All @@ -37,6 +39,7 @@ TEST 2: pgf: \pgfpathlineto
\hbox(0.0+0.0)x0.0, direction TLT
.\hbox(0.0+0.0)x0.0, direction TLT
..\special{dvisvgm:bbox 0.0 0.0}
..\special{dvisvgm:bbox lock}
..\hbox(0.0+0.0)x0.0, direction TLT
...\glue -28.45274
...\hbox(0.0+0.0)x0.0, shifted 28.45274, direction TLT
Expand All @@ -55,6 +58,7 @@ TEST 2: pgf: \pgfpathlineto
....\special{dvisvgm:raw </g>}
....\special{color pop}
....\glue 0.0 plus 1.0fil minus 1.0fil
..\special{dvisvgm:bbox unlock}
! OK.
\ENDPGFTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
Expand Down
2 changes: 2 additions & 0 deletions testfiles/pgf002.latexdvisvgm.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ TEST 1: tikz: matrix
\hbox(20.1619+0.0)x44.16382, direction TLT
.\hbox(20.1619+0.0)x44.16382, direction TLT
..\special{dvisvgm:bbox 44.16382 20.1619}
..\special{dvisvgm:bbox lock}
..\hbox(20.1619+0.0)x44.16382, direction TLT
...\glue 22.08191
...\hbox(0.0+0.0)x0.0, shifted -10.08095, direction TLT
Expand Down Expand Up @@ -144,6 +145,7 @@ TEST 1: tikz: matrix
....\special{dvisvgm:raw </g>}
....\special{color pop}
....\glue 0.0 plus 1.0fil minus 1.0fil
..\special{dvisvgm:bbox unlock}
! OK.
\ENDTIKZTEST ...h =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
Expand Down
10 changes: 9 additions & 1 deletion tex/generic/pgf/systemlayer/pgfsys-dvisvgm.def
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,15 @@
\dp#1=0pt%
\leavevmode%
\pgf@xa=\pgf@trimleft@final\relax \ifdim\pgf@xa=0pt \else\kern\pgf@xa\fi%
\raise-\pgf@ya\hbox{\ifpgf@sys@svg@inpicture\else\special{dvisvgm:bbox \pgf@sys@tonumber\pgf@picmaxx\space\pgf@sys@tonumber\pgf@picmaxy}\fi\box#1}%
\raise-\pgf@ya\hbox{%
\ifpgf@sys@svg@inpicture
\box#1%
\else
\special{dvisvgm:bbox \pgf@sys@tonumber\pgf@picmaxx\space\pgf@sys@tonumber\pgf@picmaxy}%
\special{dvisvgm:bbox lock}%
\box#1%
\special{dvisvgm:bbox unlock}%
\fi}%
\pgf@xa=\pgf@trimright@final\relax \ifdim\pgf@xa=0pt \else\kern\pgf@xa\fi%
}

Expand Down