[latex3-commits] [latex3/latex3] main, tl-build: Move softpath save/restore (de989d406)
github at latex-project.org
github at latex-project.org
Thu Oct 19 11:32:35 CEST 2023
Repository : https://github.com/latex3/latex3
On branches: main,tl-build
Link : https://github.com/latex3/latex3/commit/de989d406485ce305243ab56d76f32ef7c0965b5
>---------------------------------------------------------------
commit de989d406485ce305243ab56d76f32ef7c0965b5
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Thu Oct 19 10:32:35 2023 +0100
Move softpath save/restore
This will help when reworking tl-build,
but also ensures only limited places need
knowledge of the setup.
>---------------------------------------------------------------
de989d406485ce305243ab56d76f32ef7c0965b5
l3experimental/l3draw/l3draw-paths.dtx | 12 ++----------
l3experimental/l3draw/l3draw-softpath.dtx | 22 ++++++++++++++++++++++
2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/l3experimental/l3draw/l3draw-paths.dtx b/l3experimental/l3draw/l3draw-paths.dtx
index 41e866e56..984c119c0 100644
--- a/l3experimental/l3draw/l3draw-paths.dtx
+++ b/l3experimental/l3draw/l3draw-paths.dtx
@@ -999,19 +999,11 @@
\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:
- \tl_build_get:NN \g_@@_softpath_main_tl \l_@@_softpath_main_tl
- \bool_set_eq:NN
- \l_@@_softpath_corners_bool
- \g_@@_softpath_corners_bool
- \@@_softpath_clear:
+ \@@_softpath_save:
}
\cs_new_protected:Npn \draw_path_scope_end:
{
- \@@_softpath_clear:
- \bool_gset_eq:NN
- \g_@@_softpath_corners_bool
- \l_@@_softpath_corners_bool
- \@@_softpath_add:o \l_@@_softpath_main_tl
+ \@@_softpath_restore:
\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
diff --git a/l3experimental/l3draw/l3draw-softpath.dtx b/l3experimental/l3draw/l3draw-softpath.dtx
index d11f86966..baa442f43 100644
--- a/l3experimental/l3draw/l3draw-softpath.dtx
+++ b/l3experimental/l3draw/l3draw-softpath.dtx
@@ -120,6 +120,28 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@@_softpath_save:, \@@_softpath_restore:}
+% Abstracted ideas to keep variables inside this submodule.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_softpath_save:
+ {
+ \tl_build_get:NN \g_@@_softpath_main_tl \l_@@_softpath_main_tl
+ \bool_set_eq:NN
+ \l_@@_softpath_corners_bool
+ \g_@@_softpath_corners_bool
+ \@@_softpath_clear:
+ }
+\cs_new_protected:Npn \@@_softpath_restore:
+ {
+ \@@_softpath_clear:
+ \bool_gset_eq:NN
+ \g_@@_softpath_corners_bool
+ \l_@@_softpath_corners_bool
+ \@@_softpath_add:o \l_@@_softpath_main_tl
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{variable}{\g_@@_softpath_lastx_dim, \g_@@_softpath_lasty_dim}
% For tracking the end of the path (to close it).
% \begin{macrocode}
More information about the latex3-commits
mailing list.