[latex3-commits] [git/LaTeX3-latex3-latex3] master: l3draw: Add \draw_transform_reset: (1c81725)
Joseph Wright
joseph.wright at morningstar2.co.uk
Sun Feb 11 12:41:58 CET 2018
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/1c81725b82ad04f9ec18e6df9f214a7f3acc876a
>---------------------------------------------------------------
commit 1c81725b82ad04f9ec18e6df9f214a7f3acc876a
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Sun Feb 11 11:41:58 2018 +0000
l3draw: Add \draw_transform_reset:
>---------------------------------------------------------------
1c81725b82ad04f9ec18e6df9f214a7f3acc876a
l3trial/l3draw/l3draw-scopes.dtx | 1 +
l3trial/l3draw/l3draw-transforms.dtx | 18 ++++++++++++++++++
l3trial/l3draw/l3draw.dtx | 6 ++++++
l3trial/l3draw/testfiles/m3draw002.lvt | 8 ++++++++
l3trial/l3draw/testfiles/m3draw002.tlg | 7 +++++++
5 files changed, 40 insertions(+)
diff --git a/l3trial/l3draw/l3draw-scopes.dtx b/l3trial/l3draw/l3draw-scopes.dtx
index a4ab03f..44a889e 100644
--- a/l3trial/l3draw/l3draw-scopes.dtx
+++ b/l3trial/l3draw/l3draw-scopes.dtx
@@ -106,6 +106,7 @@
\dim_gzero:N \g_@@_ymax_dim
\dim_gzero:N \g_@@_ymin_dim
\bool_set_true:N \l_@@_update_bb_bool
+ \draw_transform_reset:
}
\cs_new_protected:Npn \draw_end:
{
diff --git a/l3trial/l3draw/l3draw-transforms.dtx b/l3trial/l3draw/l3draw-transforms.dtx
index 3798229..bf92f1e 100644
--- a/l3trial/l3draw/l3draw-transforms.dtx
+++ b/l3trial/l3draw/l3draw-transforms.dtx
@@ -83,6 +83,24 @@
% \end{macrocode}
% \end{variable}
%
+% \begin{macro}{\draw_transform_reset:}
+% Fast resetting.
+% \begin{macrocode}
+\cs_new_protected:Npn \draw_transform_reset:
+ {
+ \fp_set:Nn \l_@@_transformcm_aa_fp { 1}
+ \fp_zero:N \l_@@_transformcm_ab_fp
+ \fp_zero:N \l_@@_transformcm_ba_fp
+ \fp_set:Nn \l_@@_transformcm_bb_fp { 1 }
+ \dim_zero:N \l_@@_transformcm_xshift_dim
+ \dim_zero:N \l_@@_transformcm_yshift_dim
+ }
+\draw_transform_reset:
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\draw_transform_set:nnnnn}
% \begin{macro}{\@@_transform_set:nnnnnn}
% Setting the transform matrix is straight-forward, with just a bit
diff --git a/l3trial/l3draw/l3draw.dtx b/l3trial/l3draw/l3draw.dtx
index 8514ec5..18c62a2 100644
--- a/l3trial/l3draw/l3draw.dtx
+++ b/l3trial/l3draw/l3draw.dtx
@@ -158,6 +158,12 @@
%
% \subsection{Transformations}
%
+% \begin{function}{\draw_transform_reset:}
+% \begin{syntax}
+% \cs{draw_transform_reset:}
+% \end{syntax}
+% \end{function
+%
% \begin{function}{\draw_transform_add:nnnnn}
% \begin{syntax}
% \cs{draw_transform_add:nnnnn}
diff --git a/l3trial/l3draw/testfiles/m3draw002.lvt b/l3trial/l3draw/testfiles/m3draw002.lvt
index bdc2cc9..04b7e16 100644
--- a/l3trial/l3draw/testfiles/m3draw002.lvt
+++ b/l3trial/l3draw/testfiles/m3draw002.lvt
@@ -44,4 +44,12 @@
\exp_args:Nx \tl_show:n { \draw_point_transform:n { \l_tmpa_tl } }
}
+\TEST { \draw_transform_reset: }
+ {
+ \draw_transform_set:nnnnn { 1 } { 0 } { 1 } { 1 } { { 10pt } { 0pt } }
+ \draw_transform_reset:
+ \exp_args:Nx \tl_show:n { \draw_point_transform:n { { 1 } { 1 } } }
+ }
+
+
\END
diff --git a/l3trial/l3draw/testfiles/m3draw002.tlg b/l3trial/l3draw/testfiles/m3draw002.tlg
index 7088c36..8eb764c 100644
--- a/l3trial/l3draw/testfiles/m3draw002.tlg
+++ b/l3trial/l3draw/testfiles/m3draw002.tlg
@@ -36,3 +36,10 @@ l. ... }
<recently read> }
l. ... }
============================================================
+============================================================
+TEST 4: \draw_transform_reset:
+============================================================
+> {1pt}{1pt}.
+<recently read> }
+l. ... }
+============================================================
More information about the latex3-commits
mailing list