[latex3-commits] [git/LaTeX3-latex3-graphics-def] master: dvisvgm.def: improved clipping and page bbox (34bd005)

Alexander Grahn grahn at null.org
Sun Mar 22 18:55:13 CET 2020


Repository : https://github.com/latex3/graphics-def
On branch  : master
Link       : https://github.com/latex3/graphics-def/commit/34bd005f062e9492b5cc1e7349798cb34759c788

>---------------------------------------------------------------

commit 34bd005f062e9492b5cc1e7349798cb34759c788
Author: Alexander Grahn <grahn at null.org>
Date:   Sun Mar 22 18:55:13 2020 +0100

    dvisvgm.def: improved clipping and page bbox


>---------------------------------------------------------------

34bd005f062e9492b5cc1e7349798cb34759c788
 dvisvgm.def | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/dvisvgm.def b/dvisvgm.def
index 8999ff7..46a3c38 100644
--- a/dvisvgm.def
+++ b/dvisvgm.def
@@ -72,15 +72,27 @@
 \def\reset at color{\special{color pop}}
 \def\set at page@color{\special{bgcolor \current at color}}
 \def\define at color@named#1#2{\expandafter\let\csname col@#1\endcsname\@nnil}
-\def\Grot at start{\special{dvisvgm:raw <g transform="translate({?x},{?y})scale(1,-1)rotate(\Grot at angle)scale(-1,1)translate({?x},{?y})scale(-1)">}}
-\def\Grot at end{\special{dvisvgm:raw </g>}}
-\def\Gscale at start{\special{dvisvgm:raw <g transform="translate({?x},{?y})scale(\Gscale at x,\Gscale at y)scale(-1)translate({?x},{?y})scale(-1)">}}
-\def\Gscale at end{\special{dvisvgm:raw </g>}}
+\def\Grot at start{%
+  \special{ps: gsave currentpoint currentpoint translate \Grot at angle\GPT at space neg rotate neg exch neg exch translate}%
+  \special{dvisvgm:bbox \strip at pt\wd\z@ pt \strip at pt\ht\z@ pt \strip at pt\dp\z@ pt transform}%
+  \special{ps: grestore}%
+  \special{dvisvgm:raw <g transform="translate({?x},{?y})scale(1,-1)rotate(\Grot at angle)scale(-1,1)translate({?x},{?y})scale(-1)">}%
+  \special{dvisvgm:bbox lock}%
+}
+\def\Grot at end{\special{dvisvgm:bbox unlock}\special{dvisvgm:raw </g>}}
+\def\Gscale at start{%
+  \special{ps: gsave currentpoint currentpoint translate \Gscale at x\GPT at space \Gscale at y\GPT at space scale neg exch neg exch translate}%
+  \special{dvisvgm:bbox \strip at pt\wd\z@ pt \strip at pt\ht\z@ pt \strip at pt\dp\z@ pt transform}%
+  \special{ps: grestore}%
+  \special{dvisvgm:raw <g transform="translate({?x},{?y})scale(\Gscale at x,\Gscale at y)scale(-1)translate({?x},{?y})scale(-1)">}%
+  \special{dvisvgm:bbox lock}%
+}
+\let\Gscale at end\Grot at end
 \def\Gin at extensions{.svg,.eps,.png,.jpg,.jpeg}
 \def\Ginclude at pdf#1{\Ginclude at psorpdf{#1}{pdffile}}
 \def\Ginclude at eps#1{\let\Gin at page\@empty\Ginclude at psorpdf{#1}{PSfile}}
 \def\Ginclude at psorpdf#1#2{%
- \message{<#1>}%
+  \message{<#1>}%
   \bgroup
   \def\@tempa{!}%
   \dimen@\Gin at req@width





More information about the latex3-commits mailing list.