[latex3-commits] [latex3/latex3] main: Fix shifts under rotation in l3draw (fixes #1483) (2ea12efc6)

github at latex-project.org github at latex-project.org
Fri Mar 1 17:53:28 CET 2024


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/2ea12efc6a163bf1ae3fd0ad6d05dabc3701cf2a

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

commit 2ea12efc6a163bf1ae3fd0ad6d05dabc3701cf2a
Author: Joseph Wright <joseph at texdev.net>
Date:   Fri Mar 1 16:53:28 2024 +0000

    Fix shifts under rotation in l3draw (fixes #1483)


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

2ea12efc6a163bf1ae3fd0ad6d05dabc3701cf2a
 l3experimental/CHANGELOG.md                   | 3 +++
 l3experimental/l3draw/l3draw-transforms.dtx   | 4 ++--
 l3experimental/l3draw/testfiles/m3draw002.lvt | 8 ++++++++
 l3experimental/l3draw/testfiles/m3draw002.tlg | 7 +++++++
 4 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/l3experimental/CHANGELOG.md b/l3experimental/CHANGELOG.md
index 205c753ec..15a3b2845 100644
--- a/l3experimental/CHANGELOG.md
+++ b/l3experimental/CHANGELOG.md
@@ -10,6 +10,9 @@ this project uses date-based 'snapshot' version identifiers.
 ### Added
 - `\draw_path_replace_bb:`
 
+### Fixed
+- Interaction between drawing rotation and shift (issue \#1483)
+
 ## [2024-02-20]
 
 ### Fixed
diff --git a/l3experimental/l3draw/l3draw-transforms.dtx b/l3experimental/l3draw/l3draw-transforms.dtx
index 8e9143420..dae3329ee 100644
--- a/l3experimental/l3draw/l3draw-transforms.dtx
+++ b/l3experimental/l3draw/l3draw-transforms.dtx
@@ -219,7 +219,7 @@
         \fp_to_dim:n
           {
             #1 +
-            ( #3 * \l_@@_matrix_a_fp + #4 * \l_@@_matrix_b_fp )
+            ( #3 * \l_@@_matrix_a_fp + #4 * \l_@@_matrix_c_fp )
           }
       }
     \dim_set:Nn \l_@@_yshift_dim
@@ -227,7 +227,7 @@
         \fp_to_dim:n
           {
             #2 +
-            ( #3 * \l_@@_matrix_c_fp + #4 * \l_@@_matrix_d_fp )
+            ( #3 * \l_@@_matrix_b_fp + #4 * \l_@@_matrix_d_fp )
           }
       }
   }
diff --git a/l3experimental/l3draw/testfiles/m3draw002.lvt b/l3experimental/l3draw/testfiles/m3draw002.lvt
index bc70649c8..6f98b0af2 100644
--- a/l3experimental/l3draw/testfiles/m3draw002.lvt
+++ b/l3experimental/l3draw/testfiles/m3draw002.lvt
@@ -123,4 +123,12 @@
     \tl_show:e { \draw_point_transform:n { 1 , 1 } }
   }
 
+\TEST { \draw_transform_shift_rotate:n~and~\draw_transform_shift_shift:n }
+  {
+    \draw_transform_rotate:n { 90 }
+    \draw_transform_shift:n { 2pt , 1pt }
+    \draw_transform_matrix_reset:
+    \tl_show:e { \draw_point_transform:n { 1 , 1 } }
+  }
+
 \END
diff --git a/l3experimental/l3draw/testfiles/m3draw002.tlg b/l3experimental/l3draw/testfiles/m3draw002.tlg
index f0c35e237..194c63028 100644
--- a/l3experimental/l3draw/testfiles/m3draw002.tlg
+++ b/l3experimental/l3draw/testfiles/m3draw002.tlg
@@ -134,3 +134,10 @@ TEST 11: \draw_transform_shift_reset:
 <recently read> }
 l. ...  }
 ============================================================
+============================================================
+TEST 12: \draw_transform_shift_rotate:n and \draw_transform_shift_shift:n 
+============================================================
+> 0pt,3pt.
+<recently read> }
+l. ...  }
+============================================================





More information about the latex3-commits mailing list.