diff options
Diffstat (limited to 'macros/latex/contrib/l3experimental/l3draw-softpath.dtx')
-rw-r--r-- | macros/latex/contrib/l3experimental/l3draw-softpath.dtx | 52 |
1 files changed, 40 insertions, 12 deletions
diff --git a/macros/latex/contrib/l3experimental/l3draw-softpath.dtx b/macros/latex/contrib/l3experimental/l3draw-softpath.dtx index 44524fb17b..9419015a91 100644 --- a/macros/latex/contrib/l3experimental/l3draw-softpath.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-softpath.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-10-10} +% \date{Released 2023-11-01} % % \maketitle % @@ -82,10 +82,10 @@ % \end{macrocode} % \end{variable} % -% \begin{variable}{\l_@@_softpath_internal_tl} -% The soft path itself. +% \begin{variable}{\l_@@_softpath_tmp_tl} +% Scratch space. % \begin{macrocode} -\tl_new:N \l_@@_softpath_internal_tl +\tl_new:N \l_@@_softpath_tmp_tl % \end{macrocode} % \end{variable} % @@ -104,23 +104,51 @@ % \end{macrocode} % \end{macro} % -% \begin{macro} -% {\@@_softpath_use:, \@@_softpath_clear:} +% \begin{macro}{\@@_softpath_use:, \@@_softpath_clear:} % Using and clearing is trivial. % \begin{macrocode} \cs_new_protected:Npn \@@_softpath_use: { - \tl_build_get:NN \g_@@_softpath_main_tl \l_@@_softpath_internal_tl - \l_@@_softpath_internal_tl + \tl_build_gend:N \g_@@_softpath_main_tl + \tl_set_eq:NN \l_@@_softpath_tmp_tl \g_@@_softpath_main_tl + \l_@@_softpath_tmp_tl + \tl_build_gbegin:N \g_@@_softpath_main_tl + \exp_args:NNV \tl_build_gput_right:Nn + \g_@@_softpath_main_tl \l_@@_softpath_tmp_tl } \cs_new_protected:Npn \@@_softpath_clear: { - \tl_build_gclear:N \g_@@_softpath_main_tl + \tl_build_gbegin:N \g_@@_softpath_main_tl \bool_gset_false:N \g_@@_softpath_corners_bool } % \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_gend:N \g_@@_softpath_main_tl + \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 \@@_softpath_restore: + { + \@@_softpath_clear: + \@@_softpath_add:o \l_@@_softpath_main_tl + \bool_gset_eq:NN + \g_@@_softpath_corners_bool + \l_@@_softpath_corners_bool + } +% \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} @@ -323,9 +351,9 @@ \fp_zero:N \l_@@_softpath_lasty_fp \tl_clear:N \l_@@_softpath_first_tl \tl_clear:N \l_@@_softpath_move_tl - \tl_build_get:NN \g_@@_softpath_main_tl \l_@@_softpath_internal_tl + \tl_build_gend:N \g_@@_softpath_main_tl \exp_after:wN \@@_softpath_round_loop:Nnn - \l_@@_softpath_internal_tl + \g_@@_softpath_main_tl \q_@@_recursion_tail ? ? \q_@@_recursion_stop \group_end: @@ -587,7 +615,7 @@ \l_@@_softpath_move_tl \tl_put_right:No \l_@@_softpath_main_tl \l_@@_softpath_part_tl - \tl_build_gclear:N \g_@@_softpath_main_tl + \tl_build_gbegin:N \g_@@_softpath_main_tl \@@_softpath_add:o \l_@@_softpath_main_tl } % \end{macrocode} |