[latex3-commits] [l3svn] 08/10: Simplify drawing box usage
noreply at latex-project.org
noreply at latex-project.org
Thu May 19 21:01:29 CEST 2016
This is an automated email from the git hooks/post-receive script.
joseph pushed a commit to branch master
in repository l3svn.
commit 391d15e4a7bb56f92b51ff13a5b8924f643cb13a
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Thu May 19 19:59:30 2016 +0100
Simplify drawing box usage
There isn't really a gain in using the same number of box operations:
the outcomes are so different in terms of driver code that this
doesn't matter.
---
l3kernel/l3drivers.dtx | 38 +++++++++++++-----------------
l3kernel/testfiles/d3dvips.luatex.tlg | 2 +-
l3kernel/testfiles/d3dvips.tlg | 2 +-
l3kernel/testfiles/d3dvisvgm.luatex.tlg | 2 +-
l3kernel/testfiles/d3dvisvgm.tlg | 2 +-
l3kernel/testfiles/d3pdfmode.ptex.tlg | 2 +-
l3kernel/testfiles/d3pdfmode.uptex.tlg | 2 +-
l3kernel/testfiles/d3xdvipdfmx.ptex.tlg | 2 +-
l3kernel/testfiles/d3xdvipdfmx.uptex.tlg | 2 +-
9 files changed, 25 insertions(+), 29 deletions(-)
diff --git a/l3kernel/l3drivers.dtx b/l3kernel/l3drivers.dtx
index 0157b78..fc563a0 100755
--- a/l3kernel/l3drivers.dtx
+++ b/l3kernel/l3drivers.dtx
@@ -1723,7 +1723,6 @@
% \end{macro}
%
% \begin{macro}[int]{\@@_draw_hbox:Nnnnnnn}
-% \begin{variable}[aux]{\l_@@_tmp_box}
% Inside a picture |@beginspecial|/|@endspecial| are active, which is
% normally a good thing but means that the position and scaling will be off
% if the box is inserted directly. Instead, we need to reverse the effect of
@@ -1731,8 +1730,7 @@
% knowing where the reference point for the drawing is: saved as |l3x|/|l3y|
% at the start of the picture. Transformation here is relative to the
% drawing origin so has to be done purely in driver code not using \TeX{}
-% offsets. To keep the number of box levels equal between drivers there is
-% a no-op reboxing here (in the PDF mode version it is more useful).
+% offsets.
% \begin{macrocode}
\cs_new_protected:Npn \@@_draw_hbox:Nnnnnnn #1#2#3#4#5#6#7
{
@@ -1742,17 +1740,16 @@
\tex_special:D { ps::~72~Resolution~div~72~VResolution~div~neg~scale }
\tex_special:D { ps::~magscale~{1~DVImag~div~dup~scale}~if }
\tex_special:D { ps::~l3x~neg~l3y~neg~translate }
- \hbox_set:Nn \l_@@_tmp_box { \box_use:N #1 }
- \box_set_wd:Nn \l_@@_tmp_box { 0pt }
- \box_set_ht:Nn \l_@@_tmp_box { 0pt }
- \box_set_dp:Nn \l_@@_tmp_box { 0pt }
- \box_use:N \l__driver_tmp_box
+ \group_begin:
+ \box_set_wd:Nn #1 { 0pt }
+ \box_set_ht:Nn #1 { 0pt }
+ \box_set_dp:Nn #1 { 0pt }
+ \box_use:N #1
+ \group_end:
\tex_special:D { ps::[begin] }
\@@_scope_end:
}
-\box_new:N \l_@@_tmp_box
% \end{macrocode}
-% \end{variable}
% \end{macro}
%
% \begin{macrocode}
@@ -2386,32 +2383,31 @@
% \end{macro}
%
% \begin{macro}[int]{\@@_draw_hbox:Nnnnnnn}
-% \begin{variable}[aux]{\l_@@_tmp_box}
+% No special savings can be made here: simply displace the box inside
+% a scope. As there is nothing to re-box, just make the box passed of
+% zero size.
% \begin{macrocode}
\cs_new_protected:Npn \@@_draw_hbox:Nnnnnnn #1#2#3#4#5#6#7
{
\@@_scope_begin:
\@@_draw_transformcm:nnnnnn {#2} {#3} {#4} {#5} {#6} {#7}
- \hbox_set:Nn \l_@@_tmp_box { \box_use:N #1 }
- \box_set_wd:Nn \l_@@_tmp_box { 0pt }
- \box_set_ht:Nn \l_@@_tmp_box { 0pt }
- \box_set_dp:Nn \l_@@_tmp_box { 0pt }
\@@_literal:n
{
< g~
stroke="none"~
- transform="scale(-1,1)~
- translate({?x},{?y})~
- scale(-1,-1)"
+ transform="scale(-1,1)~translate({?x},{?y})~scale(-1,-1)"
>
}
- \box_use:N \l__driver_tmp_box
+ \group_begin:
+ \box_set_wd:Nn #1 { 0pt }
+ \box_set_ht:Nn #1 { 0pt }
+ \box_set_dp:Nn #1 { 0pt }
+ \box_use:N #1
+ \group_end:
\@@_literal:n { </g> }
\@@_scope_end:
}
-\box_new:N \l_@@_tmp_box
% \end{macrocode}
-% \end{variable}
% \end{macro}
%
% \begin{macrocode}
diff --git a/l3kernel/testfiles/d3dvips.luatex.tlg b/l3kernel/testfiles/d3dvips.luatex.tlg
index 5eea204..4094934 100644
--- a/l3kernel/testfiles/d3dvips.luatex.tlg
+++ b/l3kernel/testfiles/d3dvips.luatex.tlg
@@ -580,7 +580,7 @@ l. ... }
============================================================
TEST 4: Color
============================================================
-> \box72=
+> \box71=
\hbox(6.94444+0.0)x50.02786, direction TLT
.\special{color push gray 0}
.\OT1/cmr/m/n/10 H
diff --git a/l3kernel/testfiles/d3dvips.tlg b/l3kernel/testfiles/d3dvips.tlg
index ed3c9b6..77afc14 100644
--- a/l3kernel/testfiles/d3dvips.tlg
+++ b/l3kernel/testfiles/d3dvips.tlg
@@ -548,7 +548,7 @@ l. ... }
============================================================
TEST 4: Color
============================================================
-> \box72=
+> \box71=
\hbox(6.94444+0.0)x50.02786
.\special{color push gray 0}
.\OT1/cmr/m/n/10 H
diff --git a/l3kernel/testfiles/d3dvisvgm.luatex.tlg b/l3kernel/testfiles/d3dvisvgm.luatex.tlg
index f960a3a..c13b197 100644
--- a/l3kernel/testfiles/d3dvisvgm.luatex.tlg
+++ b/l3kernel/testfiles/d3dvisvgm.luatex.tlg
@@ -574,7 +574,7 @@ l. ... }
============================================================
TEST 4: Color
============================================================
-> \box72=
+> \box71=
\hbox(6.94444+0.0)x50.02786, direction TLT
.\special{color push gray 0}
.\OT1/cmr/m/n/10 H
diff --git a/l3kernel/testfiles/d3dvisvgm.tlg b/l3kernel/testfiles/d3dvisvgm.tlg
index b131080..fe8b8b4 100644
--- a/l3kernel/testfiles/d3dvisvgm.tlg
+++ b/l3kernel/testfiles/d3dvisvgm.tlg
@@ -546,7 +546,7 @@ l. ... }
============================================================
TEST 4: Color
============================================================
-> \box72=
+> \box71=
\hbox(6.94444+0.0)x50.02786
.\special{color push gray 0}
.\OT1/cmr/m/n/10 H
diff --git a/l3kernel/testfiles/d3pdfmode.ptex.tlg b/l3kernel/testfiles/d3pdfmode.ptex.tlg
index 56e4e93..ebe511b 100644
--- a/l3kernel/testfiles/d3pdfmode.ptex.tlg
+++ b/l3kernel/testfiles/d3pdfmode.ptex.tlg
@@ -548,7 +548,7 @@ l. ... }
============================================================
TEST 4: Color
============================================================
-> \box72=
+> \box71=
\hbox(6.94444+0.0)x50.02786
.\special{color push gray 0}
.\OT1/cmr/m/n/10 H
diff --git a/l3kernel/testfiles/d3pdfmode.uptex.tlg b/l3kernel/testfiles/d3pdfmode.uptex.tlg
index 56e4e93..ebe511b 100644
--- a/l3kernel/testfiles/d3pdfmode.uptex.tlg
+++ b/l3kernel/testfiles/d3pdfmode.uptex.tlg
@@ -548,7 +548,7 @@ l. ... }
============================================================
TEST 4: Color
============================================================
-> \box72=
+> \box71=
\hbox(6.94444+0.0)x50.02786
.\special{color push gray 0}
.\OT1/cmr/m/n/10 H
diff --git a/l3kernel/testfiles/d3xdvipdfmx.ptex.tlg b/l3kernel/testfiles/d3xdvipdfmx.ptex.tlg
index 56e4e93..ebe511b 100644
--- a/l3kernel/testfiles/d3xdvipdfmx.ptex.tlg
+++ b/l3kernel/testfiles/d3xdvipdfmx.ptex.tlg
@@ -548,7 +548,7 @@ l. ... }
============================================================
TEST 4: Color
============================================================
-> \box72=
+> \box71=
\hbox(6.94444+0.0)x50.02786
.\special{color push gray 0}
.\OT1/cmr/m/n/10 H
diff --git a/l3kernel/testfiles/d3xdvipdfmx.uptex.tlg b/l3kernel/testfiles/d3xdvipdfmx.uptex.tlg
index 56e4e93..ebe511b 100644
--- a/l3kernel/testfiles/d3xdvipdfmx.uptex.tlg
+++ b/l3kernel/testfiles/d3xdvipdfmx.uptex.tlg
@@ -548,7 +548,7 @@ l. ... }
============================================================
TEST 4: Color
============================================================
-> \box72=
+> \box71=
\hbox(6.94444+0.0)x50.02786
.\special{color push gray 0}
.\OT1/cmr/m/n/10 H
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the latex3-commits
mailing list