[latex3-commits] [git/LaTeX3-latex3-latex3] master: Path scope in the \draw_path_... area (47956b5)
Joseph Wright
joseph.wright at morningstar2.co.uk
Fri Mar 2 10:52:27 CET 2018
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/47956b59bf1dcfe10367db8865e7f5c1942eedf6
>---------------------------------------------------------------
commit 47956b59bf1dcfe10367db8865e7f5c1942eedf6
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Fri Mar 2 09:52:27 2018 +0000
Path scope in the \draw_path_... area
I have a feeling this makes more sense!
>---------------------------------------------------------------
47956b59bf1dcfe10367db8865e7f5c1942eedf6
l3experimental/l3draw/l3draw-paths.dtx | 69 +++++++++++++++++++++++++++++++
l3experimental/l3draw/l3draw-scopes.dtx | 67 ------------------------------
l3experimental/l3draw/l3draw.dtx | 26 ++++++------
3 files changed, 83 insertions(+), 79 deletions(-)
diff --git a/l3experimental/l3draw/l3draw-paths.dtx b/l3experimental/l3draw/l3draw-paths.dtx
index fb6bc93..2b5397a 100644
--- a/l3experimental/l3draw/l3draw-paths.dtx
+++ b/l3experimental/l3draw/l3draw-paths.dtx
@@ -957,6 +957,75 @@
% \end{macro}
% \end{macro}
%
+% \subsection{Scoping paths}
+%
+% \begin{variable}
+% {
+% \l_@@_path_lastx_dim, \l_@@_path_lasty_dim,
+% \l_@@_path_xmax_dim, \l_@@_path_xmin_dim,
+% \l_@@_path_ymax_dim, \l_@@_path_ymin_dim
+% }
+% \begin{variable}{\l_@@_softpath_corners_bool}
+% Local storage for global data. There is already a
+% \cs{l_@@_softpath_main_tl} for path manipulation, so we can reuse that
+% (it is always grouped when the path is being reconstructed).
+% \begin{macrocode}
+\dim_new:N \l_@@_path_lastx_dim
+\dim_new:N \l_@@_path_lasty_dim
+\dim_new:N \l_@@_path_xmax_dim
+\dim_new:N \l_@@_path_xmin_dim
+\dim_new:N \l_@@_path_ymax_dim
+\dim_new:N \l_@@_path_ymin_dim
+\dim_new:N \l_@@_softpath_lastx_dim
+\dim_new:N \l_@@_softpath_lasty_dim
+\bool_new:N \l_@@_softpath_corners_bool
+% \end{macrocode}
+% \end{variable}
+% \end{variable}
+%
+% \begin{macro}{\draw_path_scope_begin:, \draw_path_scope_end:}
+% Scoping a path is a bit more involved, largely as there are a number
+% of variables to keep hold of.
+% \begin{macrocode}
+\cs_new_protected:Npn \draw_path_scope_begin:
+ {
+ \group_begin:
+ \dim_set_eq:NN \l_@@_path_lastx_dim \g_@@_path_lastx_dim
+ \dim_set_eq:NN \l_@@_path_lasty_dim \g_@@_path_lasty_dim
+ \dim_set_eq:NN \l_@@_path_xmax_dim \g_@@_path_xmax_dim
+ \dim_set_eq:NN \l_@@_path_xmin_dim \g_@@_path_xmin_dim
+ \dim_set_eq:NN \l_@@_path_ymax_dim \g_@@_path_ymax_dim
+ \dim_set_eq:NN \l_@@_path_ymin_dim \g_@@_path_ymin_dim
+ \dim_set_eq:NN \l_@@_softpath_lastx_dim \g_@@_softpath_lastx_dim
+ \dim_set_eq:NN \l_@@_softpath_lasty_dim \g_@@_softpath_lasty_dim
+ \@@_path_reset_limits:
+ \@@_softpath_concat:n { }
+ \tl_set_eq:NN \l_@@_softpath_main_tl \g_@@_softpath_main_tl
+ \bool_set_eq:NN
+ \l_@@_softpath_corners_bool
+ \g_@@_softpath_corners_bool
+ \@@_softpath_clear:
+ }
+\cs_new_protected:Npn \draw_path_scope_end:
+ {
+ \bool_gset_eq:NN
+ \g_@@_softpath_corners_bool
+ \l_@@_softpath_corners_bool
+ \@@_softpath_clear:
+ \tl_gset_eq:NN \g_@@_softpath_main_tl \l_@@_softpath_main_tl
+ \dim_gset_eq:NN \g_@@_softpath_lastx_dim \l_@@_softpath_lastx_dim
+ \dim_gset_eq:NN \g_@@_softpath_lasty_dim \l_@@_softpath_lasty_dim
+ \dim_gset_eq:NN \g_@@_path_xmax_dim \l_@@_path_xmax_dim
+ \dim_gset_eq:NN \g_@@_path_xmin_dim \l_@@_path_xmin_dim
+ \dim_gset_eq:NN \g_@@_path_ymax_dim \l_@@_path_ymax_dim
+ \dim_gset_eq:NN \g_@@_path_ymin_dim \l_@@_path_ymin_dim
+ \dim_gset_eq:NN \g_@@_path_lastx_dim \l_@@_path_lastx_dim
+ \dim_gset_eq:NN \g_@@_path_lasty_dim \l_@@_path_lasty_dim
+ \group_end:
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
%</initex|package>
% \end{macrocode}
diff --git a/l3experimental/l3draw/l3draw-scopes.dtx b/l3experimental/l3draw/l3draw-scopes.dtx
index 92956cf..b733446 100644
--- a/l3experimental/l3draw/l3draw-scopes.dtx
+++ b/l3experimental/l3draw/l3draw-scopes.dtx
@@ -231,73 +231,6 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{variable}
-% {
-% \l_@@_path_lastx_dim, \l_@@_path_lasty_dim,
-% \l_@@_path_xmax_dim, \l_@@_path_xmin_dim,
-% \l_@@_path_ymax_dim, \l_@@_path_ymin_dim
-% }
-% \begin{variable}{\l_@@_softpath_corners_bool}
-% Local storage for global data. There is already a
-% \cs{l_@@_softpath_main_tl} for path manipulation, so we can reuse that
-% (it is always grouped when the path is being reconstructed).
-% \begin{macrocode}
-\dim_new:N \l_@@_path_lastx_dim
-\dim_new:N \l_@@_path_lasty_dim
-\dim_new:N \l_@@_path_xmax_dim
-\dim_new:N \l_@@_path_xmin_dim
-\dim_new:N \l_@@_path_ymax_dim
-\dim_new:N \l_@@_path_ymin_dim
-\dim_new:N \l_@@_softpath_lastx_dim
-\dim_new:N \l_@@_softpath_lasty_dim
-\bool_new:N \l_@@_softpath_corners_bool
-% \end{macrocode}
-% \end{variable}
-% \end{variable}
-%
-% \begin{macro}{\draw_scope_path_begin:, \draw_scope_path_end:}
-% Scoping a path is a bit more involved, largely as there are a number
-% of variables to keep hold of.
-% \begin{macrocode}
-\cs_new_protected:Npn \draw_scope_path_begin:
- {
- \group_begin:
- \dim_set_eq:NN \l_@@_path_lastx_dim \g_@@_path_lastx_dim
- \dim_set_eq:NN \l_@@_path_lasty_dim \g_@@_path_lasty_dim
- \dim_set_eq:NN \l_@@_path_xmax_dim \g_@@_path_xmax_dim
- \dim_set_eq:NN \l_@@_path_xmin_dim \g_@@_path_xmin_dim
- \dim_set_eq:NN \l_@@_path_ymax_dim \g_@@_path_ymax_dim
- \dim_set_eq:NN \l_@@_path_ymin_dim \g_@@_path_ymin_dim
- \dim_set_eq:NN \l_@@_softpath_lastx_dim \g_@@_softpath_lastx_dim
- \dim_set_eq:NN \l_@@_softpath_lasty_dim \g_@@_softpath_lasty_dim
- \@@_path_reset_limits:
- \@@_softpath_concat:n { }
- \tl_set_eq:NN \l_@@_softpath_main_tl \g_@@_softpath_main_tl
- \bool_set_eq:NN
- \l_@@_softpath_corners_bool
- \g_@@_softpath_corners_bool
- \@@_softpath_clear:
- }
-\cs_new_protected:Npn \draw_scope_path_end:
- {
- \bool_gset_eq:NN
- \g_@@_softpath_corners_bool
- \l_@@_softpath_corners_bool
- \@@_softpath_clear:
- \tl_gset_eq:NN \g_@@_softpath_main_tl \l_@@_softpath_main_tl
- \dim_gset_eq:NN \g_@@_softpath_lastx_dim \l_@@_softpath_lastx_dim
- \dim_gset_eq:NN \g_@@_softpath_lasty_dim \l_@@_softpath_lasty_dim
- \dim_gset_eq:NN \g_@@_path_xmax_dim \l_@@_path_xmax_dim
- \dim_gset_eq:NN \g_@@_path_xmin_dim \l_@@_path_xmin_dim
- \dim_gset_eq:NN \g_@@_path_ymax_dim \l_@@_path_ymax_dim
- \dim_gset_eq:NN \g_@@_path_ymin_dim \l_@@_path_ymin_dim
- \dim_gset_eq:NN \g_@@_path_lastx_dim \l_@@_path_lastx_dim
- \dim_gset_eq:NN \g_@@_path_lasty_dim \l_@@_path_lasty_dim
- \group_end:
- }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macrocode}
%</initex|package>
% \end{macrocode}
diff --git a/l3experimental/l3draw/l3draw.dtx b/l3experimental/l3draw/l3draw.dtx
index 28d51cd..7411469 100644
--- a/l3experimental/l3draw/l3draw.dtx
+++ b/l3experimental/l3draw/l3draw.dtx
@@ -282,18 +282,6 @@
% \end{itemize}
% \end{function}
%
-% \begin{function}{\draw_scope_path_begin:, \draw_scope_path_end:}
-% \begin{syntax}
-% \cs{draw_scope_path_begin:}
-% ...
-% \cs{draw_scope_path_end:}
-% \end{syntax}
-% Suspends (and saves) the current (partial) path, initialising a new
-% path within the scope. Path operations are written to output only when
-% used, so the scoped path is stored at the \pkg{expl3} level, not
-% in the output.
-% \end{function}
-%
% \subsection{Points}
%
% Functions supporting the calculation of points (co-ordinates) are expandable
@@ -829,6 +817,20 @@
% \end{demo}
% \end{function}
%
+% \subsubsection{Path scope}
+%
+% \begin{function}{\draw_path_scope_begin:, \draw_path_scope_end:}
+% \begin{syntax}
+% \cs{draw_path_scope_begin:}
+% ...
+% \cs{draw_path_scope_end:}
+% \end{syntax}
+% Suspends (and saves) the current (partial) path, initialising a new
+% path within the scope. Path operations are written to output only when
+% used, so the scoped path is stored at the \pkg{expl3} level, not
+% in the output.
+% \end{function}
+%
% \subsubsection{Path operations on canvas axes}
%
% For \emph{specialist} work, a small number of functions are provided
More information about the latex3-commits
mailing list