[latex3-commits] [git/LaTeX3-latex3-latex3] master: Re-arrange how drawing is suspended (3b62c2f)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Mar 4 12:07:28 CET 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/3b62c2fad9be9c34bba9705ff7a6a93f6c5a999d

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

commit 3b62c2fad9be9c34bba9705ff7a6a93f6c5a999d
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Mar 4 09:56:06 2018 +0000

    Re-arrange how drawing is suspended
    
    This is the pgf way and will allow us to avoid
    needing lots of box/coffin functions.


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

3b62c2fad9be9c34bba9705ff7a6a93f6c5a999d
 l3experimental/l3draw/l3draw-boxes.dtx  |    8 ++------
 l3experimental/l3draw/l3draw-scopes.dtx |   18 ++++++++++++++++++
 l3experimental/l3draw/l3draw.dtx        |   11 +++++++++++
 3 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/l3experimental/l3draw/l3draw-boxes.dtx b/l3experimental/l3draw/l3draw-boxes.dtx
index c037ffe..024a334 100644
--- a/l3experimental/l3draw/l3draw-boxes.dtx
+++ b/l3experimental/l3draw/l3draw-boxes.dtx
@@ -78,13 +78,9 @@
     \hbox_set:Nn #1
       {
         \color_ensure_current:
-        \@@_scope_bb_begin:
-        \draw_path_scope_begin:
-        \draw_transform_matrix_reset:
-        \draw_transform_shift_reset:
+        \draw_suspend_begin:
           #2
-        \draw_path_scope_end:
-        \@@_scope_bb_end:
+        \draw_suspend_end:
       }
   }
 %    \end{macrocode}
diff --git a/l3experimental/l3draw/l3draw-scopes.dtx b/l3experimental/l3draw/l3draw-scopes.dtx
index 374ed8c..0a6d0f0 100644
--- a/l3experimental/l3draw/l3draw-scopes.dtx
+++ b/l3experimental/l3draw/l3draw-scopes.dtx
@@ -228,6 +228,24 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\draw_suspend_begin:, \draw_suspend_end:}
+%   Suspend all parts of a drawing.
+%    \begin{macrocode}
+\cs_new_protected:Npn \draw_suspend_begin:
+  {
+    \@@_scope_bb_begin:
+    \draw_path_scope_begin:
+    \draw_transform_matrix_reset:
+    \draw_transform_shift_reset:
+  }
+\cs_new_protected:Npn \draw_suspend_end:
+  {
+    \draw_path_scope_end:
+    \@@_scope_bb_end:
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
 %</initex|package>
 %    \end{macrocode}
diff --git a/l3experimental/l3draw/l3draw.dtx b/l3experimental/l3draw/l3draw.dtx
index 8336dad..85336ba 100644
--- a/l3experimental/l3draw/l3draw.dtx
+++ b/l3experimental/l3draw/l3draw.dtx
@@ -176,6 +176,17 @@
 % axes at the driver level: this is then \enquote{transparent} to the
 % \pkg{draw} level, and so should be used only when strictly required.)
 %
+% \begin{function}{\draw_suspend_begin:, \draw_suspend_end:}
+%   \begin{syntax}
+%     \cs{draw_suspend_begin:}
+%     ...
+%     \cs{draw_suspend_end:}
+%   \end{syntax}
+%   Suspends all of the drawing mechanisms to allow \enquote{normal}
+%   material to be created. Typically, this environment will be applied
+%   inside a box which may contain nested pictures.
+% \end{function}
+%
 % \subsection{Graphics state}
 %
 % Within the drawing environment, a number of functions control how drawings





More information about the latex3-commits mailing list