[latex3-commits] [git/LaTeX3-latex3-latex3] master: Update l3draw transformation names (da3dbb7)
Joseph Wright
joseph.wright at morningstar2.co.uk
Mon Feb 11 15:17:16 CET 2019
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/da3dbb7b967116549e85b754008ee0fd2116985f
>---------------------------------------------------------------
commit da3dbb7b967116549e85b754008ee0fd2116985f
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Mon Feb 11 14:16:53 2019 +0000
Update l3draw transformation names
>---------------------------------------------------------------
da3dbb7b967116549e85b754008ee0fd2116985f
l3experimental/CHANGELOG.md | 4 ++
l3experimental/l3draw/l3draw-transforms.dtx | 56 ++++++++++++-------------
l3experimental/l3draw/l3draw.dtx | 15 +++----
l3experimental/l3draw/testfiles/m3draw002.lvt | 19 +++++++--
l3experimental/l3draw/testfiles/m3draw002.tlg | 30 +++++++++----
5 files changed, 78 insertions(+), 46 deletions(-)
diff --git a/l3experimental/CHANGELOG.md b/l3experimental/CHANGELOG.md
index c863120..7de63f7 100644
--- a/l3experimental/CHANGELOG.md
+++ b/l3experimental/CHANGELOG.md
@@ -7,6 +7,10 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+### Changed
+
+- Update `l3draw` transformation names
+
## [2019-01-28]
### Changed
diff --git a/l3experimental/l3draw/l3draw-transforms.dtx b/l3experimental/l3draw/l3draw-transforms.dtx
index cbaaa90..782f05f 100644
--- a/l3experimental/l3draw/l3draw-transforms.dtx
+++ b/l3experimental/l3draw/l3draw-transforms.dtx
@@ -121,14 +121,14 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\draw_transform_matrix:nnnn}
-% \begin{macro}{\draw_transform_shift:n}
-% \begin{macro}{\@@_transform_shift:nn}
+% \begin{macro}{\draw_transform_matrix_absolute:nnnn}
+% \begin{macro}{\draw_transform_shift_absolute:n}
+% \begin{macro}{\@@_transform_shift_absolute:nn}
% Setting the transform matrix is straight-forward, with just a bit
% of expansion to sort out. With the mechanism active, the identity
% matrix is set.
% \begin{macrocode}
-\cs_new_protected:Npn \draw_transform_matrix:nnnn #1#2#3#4
+\cs_new_protected:Npn \draw_transform_matrix_absolute:nnnn #1#2#3#4
{
\fp_set:Nn \l_@@_matrix_a_fp {#1}
\fp_set:Nn \l_@@_matrix_b_fp {#2}
@@ -144,12 +144,12 @@
{ \bool_set_false:N \l_@@_matrix_active_bool }
{ \bool_set_true:N \l_@@_matrix_active_bool }
}
-\cs_new_protected:Npn \draw_transform_shift:n #1
+\cs_new_protected:Npn \draw_transform_shift_absolute:n #1
{
\@@_point_process:nn
- { \@@_transform_shift:nn } {#1}
+ { \@@_transform_shift_absolute:nn } {#1}
}
-\cs_new_protected:Npn \@@_transform_shift:nn #1#2
+\cs_new_protected:Npn \@@_transform_shift_absolute:nn #1#2
{
\dim_set:Nn \l_@@_xshift_dim {#1}
\dim_set:Nn \l_@@_yshift_dim {#2}
@@ -159,41 +159,41 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\draw_transform_matrix_concat:nnnn}
-% \begin{macro}{\@@_transform_concat:nnnn}
-% \begin{macro}{\draw_transform_shift_concat:n}
-% \begin{macro}{\@@_transform_shift_concat:nn}
+% \begin{macro}{\draw_transform_matrix:nnnn}
+% \begin{macro}{\@@_transform:nnnn}
+% \begin{macro}{\draw_transform_shift:n}
+% \begin{macro}{\@@_transform_shift:nn}
% Much the same story for adding to an existing matrix, with a bit of
% pre-expansion so that the calculation uses \enquote{frozen} values.
% \begin{macrocode}
-\cs_new_protected:Npn \draw_transform_matrix_concat:nnnn #1#2#3#4
+\cs_new_protected:Npn \draw_transform_matrix:nnnn #1#2#3#4
{
\use:x
{
- \@@_transform_concat:nnnn
+ \@@_transform:nnnn
{ \fp_eval:n {#1} }
{ \fp_eval:n {#2} }
{ \fp_eval:n {#3} }
{ \fp_eval:n {#4} }
}
}
-\cs_new_protected:Npn \@@_transform_concat:nnnn #1#2#3#4
+\cs_new_protected:Npn \@@_transform:nnnn #1#2#3#4
{
\use:x
{
- \draw_transform_matrix:nnnn
+ \draw_transform_matrix_absolute:nnnn
{ #1 * \l_@@_matrix_a_fp + #2 * \l_@@_matrix_c_fp }
{ #1 * \l_@@_matrix_b_fp + #2 * \l_@@_matrix_d_fp }
{ #3 * \l_@@_matrix_a_fp + #4 * \l_@@_matrix_c_fp }
{ #3 * \l_@@_matrix_b_fp + #4 * \l_@@_matrix_d_fp }
}
}
-\cs_new_protected:Npn \draw_transform_shift_concat:n #1
+\cs_new_protected:Npn \draw_transform_shift:n #1
{
\@@_point_process:nn
- { \@@_transform_shift_concat:nn } {#1}
+ { \@@_transform_shift:nn } {#1}
}
-\cs_new_protected:Npn \@@_transform_shift_concat:nn #1#2
+\cs_new_protected:Npn \@@_transform_shift:nn #1#2
{
\dim_set:Nn \l_@@_xshift_dim { \l_@@_xshift_dim + #1 }
\dim_set:Nn \l_@@_yshift_dim { \l_@@_yshift_dim + #2 }
@@ -267,12 +267,12 @@
{
\use:x
{
- \draw_transform_matrix:nnnn
+ \draw_transform_matrix_absolute:nnnn
{ #3 - #1 }
{ #4 - #2 }
{ #5 - #1 }
{ #6 - #2 }
- \draw_transform_shift:n { #1 , #2 }
+ \draw_transform_shift_absolute:n { #1 , #2 }
}
}
% \end{macrocode}
@@ -287,19 +287,19 @@
% Lots of shortcuts.
% \begin{macrocode}
\cs_new_protected:Npn \draw_transform_scale:n #1
- { \draw_transform_matrix_concat:nnnn { #1 } { 0 } { 0 } { #1 } }
+ { \draw_transform_matrix:nnnn { #1 } { 0 } { 0 } { #1 } }
\cs_new_protected:Npn \draw_transform_xscale:n #1
- { \draw_transform_matrix_concat:nnnn { #1 } { 0 } { 0 } { 1 } }
+ { \draw_transform_matrix:nnnn { #1 } { 0 } { 0 } { 1 } }
\cs_new_protected:Npn \draw_transform_yscale:n #1
- { \draw_transform_matrix_concat:nnnn { 1 } { 0 } { 0 } { #1 } }
+ { \draw_transform_matrix:nnnn { 1 } { 0 } { 0 } { #1 } }
\cs_new_protected:Npn \draw_transform_xshift:n #1
- { \draw_transform_shift_concat:n { #1 , 0pt } }
+ { \draw_transform_shift:n { #1 , 0pt } }
\cs_new_protected:Npn \draw_transform_yshift:n #1
- { \draw_transform_shift_concat:n { 0pt , #1 } }
+ { \draw_transform_shift:n { 0pt , #1 } }
\cs_new_protected:Npn \draw_transform_xslant:n #1
- { \draw_transform_matrix_concat:nnnn { 1 } { 0 } { #1 } { 1 } }
+ { \draw_transform_matrix:nnnn { 1 } { 0 } { #1 } { 1 } }
\cs_new_protected:Npn \draw_transform_yslant:n #1
- { \draw_transform_matrix_concat:nnnn { 1 } { #1 } { 0 } { 1 } }
+ { \draw_transform_matrix:nnnn { 1 } { #1 } { 0 } { 1 } }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -324,7 +324,7 @@
}
\cs_generate_variant:Nn \@@_transform_rotate:n { f }
\cs_new_protected:Npn \@@_transform_rotate:nn #1#2
- { \draw_transform_matrix_concat:nnnn {#1} {#2} { -#2 } { #1 } }
+ { \draw_transform_matrix:nnnn {#1} {#2} { -#2 } { #1 } }
\cs_generate_variant:Nn \@@_transform_rotate:nn { ff }
% \end{macrocode}
% \end{macro}
diff --git a/l3experimental/l3draw/l3draw.dtx b/l3experimental/l3draw/l3draw.dtx
index 5ee9f41..e38da04 100644
--- a/l3experimental/l3draw/l3draw.dtx
+++ b/l3experimental/l3draw/l3draw.dtx
@@ -943,7 +943,7 @@
% \end{demo}
% \begin{demo}
% \draw_begin:
-% \draw_transform_matrix:nnnn { 2 } { 0 } { 1 } { 2 }
+% \draw_transform_matrix_absolute:nnnn { 2 } { 0 } { 1 } { 2 }
% \draw_path_moveto:n { 0cm , 0cm }
% \draw_path_lineto:n { 0cm , 1cm }
% \draw_path_use_clear:n { stroke }
@@ -993,23 +993,24 @@
% is transparent to the drawing code so is not tracked.
%
% \begin{function}
-% {\draw_transform_matrix:nnnn, \draw_transform_matrix_concat:nnnn}
+% {\draw_transform_matrix:nnnn, \draw_transform_matrix_absolute:nnnn}
% \begin{syntax}
% \cs{draw_transform_matrix:nnnn}
% \Arg{a} \Arg{b} \Arg{c} \Arg{d}
% \end{syntax}
% Applies the transformation matrix $[ \meta{a} \meta{b} \meta{c} \meta{d}]$.
-% The basic version over-writes the current matrix, the |concat| version
-% concatenates.
+% The basic applies the transformation in addition to those active; the
+% |absolute| version overwrites any active transformation.
% This assignment is local.
% \end{function}
%
-% \begin{function}{\draw_transform_shift:n, \draw_transform_shift_concat:n}
+% \begin{function}{\draw_transform_shift:n, \draw_transform_shift_absolute:n}
% \begin{syntax}
% \cs{draw_transform_shift:n} \Arg{vector}
% \end{syntax}
-% Applies the transformation \meta{vector} to points. The basic version
-% over-writes the current vector, the |concat| version concatenates.
+% Applies the transformation \meta{vector} to points.
+% The basic applies the vector in addition to those active; the
+% |absolute| version overwrites any active vector.
% This assignment is local.
% \end{function}
%
diff --git a/l3experimental/l3draw/testfiles/m3draw002.lvt b/l3experimental/l3draw/testfiles/m3draw002.lvt
index 960c4f1..cabed3c 100644
--- a/l3experimental/l3draw/testfiles/m3draw002.lvt
+++ b/l3experimental/l3draw/testfiles/m3draw002.lvt
@@ -17,19 +17,21 @@
\START
-\TEST { \draw_transform_matrix:nnnn }
+\TEST { \draw_transform_matrix:nnnnn }
{
\exp_args:Nx \tl_show:n { \draw_point_transform:n { 1pt , 1pt } }
\draw_transform_matrix:nnnn { 1 } { 1 } { 1 } { 1 }
\exp_args:Nx \tl_show:n { \draw_point_transform:n { 1pt , 1pt } }
+ \draw_transform_matrix:nnnn { 2 } { 0 } { 0 } { 1 }
+ \exp_args:Nx \tl_show:n { \draw_point_transform:n { 1pt , 1pt } }
}
-\TEST { \draw_transform_matrix_concat:nnnnn }
+\TEST { \draw_transform_matrix_absolute:nnnn }
{
\exp_args:Nx \tl_show:n { \draw_point_transform:n { 1pt , 1pt } }
- \draw_transform_matrix_concat:nnnn { 1 } { 1 } { 1 } { 1 }
+ \draw_transform_matrix_absolute:nnnn { 1 } { 1 } { 1 } { 1 }
\exp_args:Nx \tl_show:n { \draw_point_transform:n { 1pt , 1pt } }
- \draw_transform_matrix_concat:nnnn { 2 } { 0 } { 0 } { 1 }
+ \draw_transform_matrix_absolute:nnnn { 2 } { 0 } { 0 } { 1 }
\exp_args:Nx \tl_show:n { \draw_point_transform:n { 1pt , 1pt } }
}
@@ -70,6 +72,15 @@
\exp_args:Nx \tl_show:n { \draw_point_transform:n { 1pt , 1pt } }
}
+\TEST { \draw_transform_shift_absolute:n }
+ {
+ \exp_args:Nx \tl_show:n { \draw_point_transform:n { 1 , 1 } }
+ \draw_transform_shift_absolute:n { 10pt, 10pt }
+ \exp_args:Nx \tl_show:n { \draw_point_transform:n { 1 , 1 } }
+ \draw_transform_shift_absolute:n { 10pt, 10pt }
+ \exp_args:Nx \tl_show:n { \draw_point_transform:n { 1 , 1 } }
+ }
+
\TEST { \draw_transform_slant:n }
{
\exp_args:Nx \tl_show:n { \draw_point_transform:n { 1pt , 1pt } }
diff --git a/l3experimental/l3draw/testfiles/m3draw002.tlg b/l3experimental/l3draw/testfiles/m3draw002.tlg
index aaa5eb2..2b7a287 100644
--- a/l3experimental/l3draw/testfiles/m3draw002.tlg
+++ b/l3experimental/l3draw/testfiles/m3draw002.tlg
@@ -1,7 +1,7 @@
This is a generated file for the LaTeX (2e + expl3) validation system.
Don't change this file in any respect.
============================================================
-TEST 1: \draw_transform_matrix:nnnn
+TEST 1: \draw_transform_matrix:nnnnn
============================================================
> 1pt,1pt.
<recently read> }
@@ -9,9 +9,12 @@ l. ... }
> 2pt,2pt.
<recently read> }
l. ... }
+> 3pt,3pt.
+<recently read> }
+l. ... }
============================================================
============================================================
-TEST 2: \draw_transform_matrix_concat:nnnnn
+TEST 2: \draw_transform_matrix_absolute:nnnn
============================================================
> 1pt,1pt.
<recently read> }
@@ -19,7 +22,7 @@ l. ... }
> 2pt,2pt.
<recently read> }
l. ... }
-> 3pt,3pt.
+> 2pt,1pt.
<recently read> }
l. ... }
============================================================
@@ -76,7 +79,20 @@ l. ... }
l. ... }
============================================================
============================================================
-TEST 7: \draw_transform_slant:n
+TEST 7: \draw_transform_shift_absolute:n
+============================================================
+> 1pt,1pt.
+<recently read> }
+l. ... }
+> 11pt,11pt.
+<recently read> }
+l. ... }
+> 11pt,11pt.
+<recently read> }
+l. ... }
+============================================================
+============================================================
+TEST 8: \draw_transform_slant:n
============================================================
> 1pt,1pt.
<recently read> }
@@ -89,7 +105,7 @@ l. ... }
l. ... }
============================================================
============================================================
-TEST 8: \draw_transform_matrix_invert:
+TEST 9: \draw_transform_matrix_invert:
============================================================
> \l_tmpa_tl=2pt,1pt.
<recently read> }
@@ -99,14 +115,14 @@ l. ... }
l. ... }
============================================================
============================================================
-TEST 9: \draw_transform_matrix_reset:
+TEST 10: \draw_transform_matrix_reset:
============================================================
> 1pt,1pt.
<recently read> }
l. ... }
============================================================
============================================================
-TEST 10: \draw_transform_shift_reset:
+TEST 11: \draw_transform_shift_reset:
============================================================
> 1pt,1pt.
<recently read> }
More information about the latex3-commits
mailing list