[latex3-commits] [git/LaTeX3-latex3-latex3] master: Explore expandable l3draw point setting (2f459a9)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Feb 7 10:20:17 CET 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/2f459a9a00111ff814f8975edbc2e1ef3d44ef28

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

commit 2f459a9a00111ff814f8975edbc2e1ef3d44ef28
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Feb 7 09:20:17 2018 +0000

    Explore expandable l3draw point setting
    
    This may well make the code clearer: worth at least trying out.


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

2f459a9a00111ff814f8975edbc2e1ef3d44ef28
 l3trial/l3draw/l3draw-points.dtx       |   24 +++++++-----------------
 l3trial/l3draw/testfiles/m3draw000.tlg |    2 --
 2 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/l3trial/l3draw/l3draw-points.dtx b/l3trial/l3draw/l3draw-points.dtx
index 1372a1b..e061b10 100644
--- a/l3trial/l3draw/l3draw-points.dtx
+++ b/l3trial/l3draw/l3draw-points.dtx
@@ -60,33 +60,23 @@
 %<@@=draw>
 %    \end{macrocode}
 %
-% \begin{variable}{\g_@@_x_dim, \g_@@_y_dim}
-%   The \enquote{next}or \enquote{active} point.
-%    \begin{macrocode}
-\dim_new:N \g_@@_x_dim
-\dim_new:N \g_@@_y_dim
-%    \end{macrocode}
-% \end{variable}
-%
-% \begin{macro}{\@@_set_point:n}
+% \begin{macro}{\@@_pass_point:nN}
 %   Execute whatever code is passed to extract the $x$ and $y$ co-ordinates.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_set_point:n #1
+\cs_new_protected:Npn \@@_pass_point:nN #1#2
   {
-    \group_begin:
-      #1
-    \group_end:
+    \use:x { \exp_not:N #2 #1 }
   }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\draw_point:nn}
+% \begin{macro}[EXP]{\draw_point:nn}
 %   Simply turn the given values into dimensions.
 %    \begin{macrocode}
-\cs_new_protected:Npn \draw_point:nn #1#2
+\cs_new:Npn \draw_point:nn #1#2
   {
-    \dim_gset:Nn \g_@@_x_dim { \fp_to_dim:n {#1} }
-    \dim_gset:Nn \g_@@_y_dim { \fp_to_dim:n {#2} }
+    { \fp_to_dim:n {#1} }
+    { \fp_to_dim:n {#2} }
   }
 %    \end{macrocode}
 % \end{macro}
diff --git a/l3trial/l3draw/testfiles/m3draw000.tlg b/l3trial/l3draw/testfiles/m3draw000.tlg
index 4486cfb..a17ff47 100644
--- a/l3trial/l3draw/testfiles/m3draw000.tlg
+++ b/l3trial/l3draw/testfiles/m3draw000.tlg
@@ -8,8 +8,6 @@ Author: Joseph Wright
 \g__draw_path_xmin_dim=\dimen...
 \g__draw_path_ymax_dim=\dimen...
 \g__draw_path_ymin_dim=\dimen...
-\g__draw_x_dim=\dimen...
-\g__draw_y_dim=\dimen...
 \g__draw_xmax_dim=\dimen...
 \g__draw_xmin_dim=\dimen...
 \g__draw_ymax_dim=\dimen...





More information about the latex3-commits mailing list