[latex3-commits] [latex3/latex3] main: Fix out-of-boundary grid lines in l3draw (fixes #1489) (6fc1aac5b)
github at latex-project.org
github at latex-project.org
Sat Mar 2 16:18:13 CET 2024
Repository : https://github.com/latex3/latex3
On branch : main
Link : https://github.com/latex3/latex3/commit/6fc1aac5be926c20a8eff315b209b6970e58f425
>---------------------------------------------------------------
commit 6fc1aac5be926c20a8eff315b209b6970e58f425
Author: Yukai Chou <muzimuzhi at gmail.com>
Date: Sat Mar 2 17:37:25 2024 +0800
Fix out-of-boundary grid lines in l3draw (fixes #1489)
>---------------------------------------------------------------
6fc1aac5be926c20a8eff315b209b6970e58f425
l3experimental/CHANGELOG.md | 1 +
l3experimental/l3draw/l3draw-paths.dtx | 4 +-
.../l3draw/testfiles/m3draw003.etex-dvips.tlg | 46 ++++++++++++++++++++++
.../l3draw/testfiles/m3draw003.etex-dvisvgm.tlg | 28 +++++++++++++
l3experimental/l3draw/testfiles/m3draw003.lvt | 8 ++++
l3experimental/l3draw/testfiles/m3draw003.tlg | 39 ++++++++++++++++++
.../l3draw/testfiles/m3draw003.uptex.tlg | 46 ++++++++++++++++++++++
.../l3draw/testfiles/m3draw003.xetex.tlg | 39 ++++++++++++++++++
8 files changed, 209 insertions(+), 2 deletions(-)
diff --git a/l3experimental/CHANGELOG.md b/l3experimental/CHANGELOG.md
index ac248276c..3e34bed33 100644
--- a/l3experimental/CHANGELOG.md
+++ b/l3experimental/CHANGELOG.md
@@ -16,6 +16,7 @@ this project uses date-based 'snapshot' version identifiers.
### Fixed
- Interaction between drawing rotation and shift (issue \#1483)
- Shifting not applied to `\draw_path_rectangle:n` (issue \#1486)
+- Out of boundary lines drawn by `\draw_path_grid:nnn` (issue \#1489)
## [2024-02-20]
diff --git a/l3experimental/l3draw/l3draw-paths.dtx b/l3experimental/l3draw/l3draw-paths.dtx
index 53e6a382d..fc2bc1f73 100644
--- a/l3experimental/l3draw/l3draw-paths.dtx
+++ b/l3experimental/l3draw/l3draw-paths.dtx
@@ -789,8 +789,8 @@
\cs_new_protected:Npn \@@_path_grid_auxiii:nnnnnn #1#2#3#4#5#6
{
\@@_path_grid_auxiv:eennnnnn
- { \fp_to_dim:n { #1 * trunc(#3/(#1)) } }
- { \fp_to_dim:n { #2 * trunc(#4/(#2)) } }
+ { \fp_to_dim:n { #1 * ceil(#3/(#1)) } }
+ { \fp_to_dim:n { #2 * ceil(#4/(#2)) } }
{#1} {#2} {#3} {#4} {#5} {#6}
}
\cs_new_protected:Npn \@@_path_grid_auxiv:nnnnnnnn #1#2#3#4#5#6#7#8
diff --git a/l3experimental/l3draw/testfiles/m3draw003.etex-dvips.tlg b/l3experimental/l3draw/testfiles/m3draw003.etex-dvips.tlg
index 89ecf41f7..6612b23c7 100644
--- a/l3experimental/l3draw/testfiles/m3draw003.etex-dvips.tlg
+++ b/l3experimental/l3draw/testfiles/m3draw003.etex-dvips.tlg
@@ -945,6 +945,52 @@ l. ... }
! OK.
<argument> \l_tmpa_box
l. ... }
+> \box...=
+\hbox(142.66377+0.0)x142.66377
+.\hbox(142.66377+0.0)x142.66377
+..\glue -14.02638
+..\hbox(0.0+0.0)x0.0, shifted 14.02638
+...\special{ps::[begin]}
+...\special{ps::@beginspecial}
+...\special{ps::0.39851 setlinewidth}
+...\special{color push gray 0}
+...\special{ps:SDict begin /color.sc {} def end}
+...\special{ps::0 setlinecap}
+...\special{ps::0 setlinejoin}
+...\special{ps::10 setmiterlimit}
+...\special{ps::[] 0 setdash}
+...\hbox(0.0+0.0)x0.0
+....\special{ps::28.34645 14.17323 moveto}
+....\special{ps::28.34645 155.90552 lineto}
+....\special{ps::56.6929 14.17323 moveto}
+....\special{ps::56.6929 155.90552 lineto}
+....\special{ps::85.03934 14.17323 moveto}
+....\special{ps::85.03934 155.90552 lineto}
+....\special{ps::113.38579 14.17323 moveto}
+....\special{ps::113.38579 155.90552 lineto}
+....\special{ps::141.73222 14.17323 moveto}
+....\special{ps::141.73222 155.90552 lineto}
+....\special{ps::14.17323 28.34645 moveto}
+....\special{ps::155.90552 28.34645 lineto}
+....\special{ps::14.17323 56.6929 moveto}
+....\special{ps::155.90552 56.6929 lineto}
+....\special{ps::14.17323 85.03934 moveto}
+....\special{ps::155.90552 85.03934 lineto}
+....\special{ps::14.17323 113.38579 moveto}
+....\special{ps::155.90552 113.38579 lineto}
+....\special{ps::14.17323 141.73222 moveto}
+....\special{ps::155.90552 141.73222 lineto}
+....\special{ps::gsave}
+....\special{ps::color.sc}
+....\special{ps::stroke}
+....\special{ps::grestore}
+....\special{ps::newpath}
+...\special{ps::@endspecial}
+...\special{ps::[end]}
+...\special{color pop}
+! OK.
+<argument> \l_tmpa_box
+l. ... }
============================================================
============================================================
TEST 12: \draw_path_canvas_moveto:n
diff --git a/l3experimental/l3draw/testfiles/m3draw003.etex-dvisvgm.tlg b/l3experimental/l3draw/testfiles/m3draw003.etex-dvisvgm.tlg
index 683d0aee9..cc30b5b3a 100644
--- a/l3experimental/l3draw/testfiles/m3draw003.etex-dvisvgm.tlg
+++ b/l3experimental/l3draw/testfiles/m3draw003.etex-dvisvgm.tlg
@@ -827,6 +827,34 @@ l. ... }
! OK.
<argument> \l_tmpa_box
l. ... }
+> \box...=
+\hbox(142.66377+0.0)x142.66377
+.\hbox(142.66377+0.0)x142.66377
+..\glue -14.02638
+..\hbox(0.0+0.0)x0.0, shifted 14.02638
+...\special{dvisvgm:raw <g>{?nl}}
+...\special{dvisvgm:raw <g transform="translate({?x},{?y}) scale(1,-1)">{?nl}}
+...\special{dvisvgm:raw <g stroke-width="0.4">{?nl}}
+...\special{color push gray 0}
+...\special{dvisvgm:raw <g fill-rule="nonzero">{?nl}}
+...\special{dvisvgm:raw <g stroke-linecap="butt">{?nl}}
+...\special{dvisvgm:raw <g stroke-linejoin="miter">{?nl}}
+...\special{dvisvgm:raw <g stroke-miterlimit="10">{?nl}}
+...\special{dvisvgm:raw <g stroke-dasharray="none" stroke-offset="0">{?nl}}
+...\hbox(0.0+0.0)x0.0
+....\special{dvisvgm:raw <path d="M 28.45274 14.22638 L 28.45274 156.49016 M 56.90549 14.22638 L 56.90549 156.49016 M 85.35823 14.22638 L 85.35823 156.49016 M 113.81097 14.22638 L 113.81097 156.49016 M 142.26372 14.22638 L 142.26372 156.49016 M 14.22638 28.45274 L 156.49016 28.45274 M 14.22638 56.90549 L 156.49016 56.90549 M 14.22638 85.35823 L 156.49016 85.35823 M 14.22638 113.81097 L 156.49016 113.81097 M 14.22638 142.26372 L 156.49016 142.26372" style="fill:none"/>{?nl}}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{color pop}
+! OK.
+<argument> \l_tmpa_box
+l. ... }
============================================================
============================================================
TEST 12: \draw_path_canvas_moveto:n
diff --git a/l3experimental/l3draw/testfiles/m3draw003.lvt b/l3experimental/l3draw/testfiles/m3draw003.lvt
index 6094c5edd..3230db2ca 100644
--- a/l3experimental/l3draw/testfiles/m3draw003.lvt
+++ b/l3experimental/l3draw/testfiles/m3draw003.lvt
@@ -231,6 +231,14 @@
{ 0cm , 0cm }
{ 5cm , 5cm }
}
+ \test:n
+ {
+ \draw_path_grid:nnnn
+ { 1cm }
+ { 1cm }
+ { .5cm , .5cm }
+ { 5.5cm , 5.5cm }
+ }
}
\TEST { \draw_path_canvas_moveto:n }
diff --git a/l3experimental/l3draw/testfiles/m3draw003.tlg b/l3experimental/l3draw/testfiles/m3draw003.tlg
index 040ad89f1..6e2d86581 100644
--- a/l3experimental/l3draw/testfiles/m3draw003.tlg
+++ b/l3experimental/l3draw/testfiles/m3draw003.tlg
@@ -749,6 +749,45 @@ l. ... }
! OK.
<argument> \l_tmpa_box
l. ... }
+> \box...=
+\hbox(142.66377+0.0)x142.66377
+.\hbox(142.66377+0.0)x142.66377
+..\glue -14.02638
+..\hbox(0.0+0.0)x0.0, shifted 14.02638
+...\pdfsave
+...\pdfliteral{0.39851 w}
+...\pdfcolorstack 0 push {0 g 0 G}
+...\pdfliteral{0 J}
+...\pdfliteral{0 j}
+...\pdfliteral{10 M}
+...\pdfliteral{[] 0 d}
+...\hbox(0.0+0.0)x0.0
+....\pdfliteral{28.34645 14.17323 m}
+....\pdfliteral{28.34645 155.90552 l}
+....\pdfliteral{56.6929 14.17323 m}
+....\pdfliteral{56.6929 155.90552 l}
+....\pdfliteral{85.03934 14.17323 m}
+....\pdfliteral{85.03934 155.90552 l}
+....\pdfliteral{113.38579 14.17323 m}
+....\pdfliteral{113.38579 155.90552 l}
+....\pdfliteral{141.73222 14.17323 m}
+....\pdfliteral{141.73222 155.90552 l}
+....\pdfliteral{14.17323 28.34645 m}
+....\pdfliteral{155.90552 28.34645 l}
+....\pdfliteral{14.17323 56.6929 m}
+....\pdfliteral{155.90552 56.6929 l}
+....\pdfliteral{14.17323 85.03934 m}
+....\pdfliteral{155.90552 85.03934 l}
+....\pdfliteral{14.17323 113.38579 m}
+....\pdfliteral{155.90552 113.38579 l}
+....\pdfliteral{14.17323 141.73222 m}
+....\pdfliteral{155.90552 141.73222 l}
+....\pdfliteral{S}
+...\pdfrestore
+...\pdfcolorstack 0 pop
+! OK.
+<argument> \l_tmpa_box
+l. ... }
============================================================
============================================================
TEST 12: \draw_path_canvas_moveto:n
diff --git a/l3experimental/l3draw/testfiles/m3draw003.uptex.tlg b/l3experimental/l3draw/testfiles/m3draw003.uptex.tlg
index 89ecf41f7..6612b23c7 100644
--- a/l3experimental/l3draw/testfiles/m3draw003.uptex.tlg
+++ b/l3experimental/l3draw/testfiles/m3draw003.uptex.tlg
@@ -945,6 +945,52 @@ l. ... }
! OK.
<argument> \l_tmpa_box
l. ... }
+> \box...=
+\hbox(142.66377+0.0)x142.66377
+.\hbox(142.66377+0.0)x142.66377
+..\glue -14.02638
+..\hbox(0.0+0.0)x0.0, shifted 14.02638
+...\special{ps::[begin]}
+...\special{ps::@beginspecial}
+...\special{ps::0.39851 setlinewidth}
+...\special{color push gray 0}
+...\special{ps:SDict begin /color.sc {} def end}
+...\special{ps::0 setlinecap}
+...\special{ps::0 setlinejoin}
+...\special{ps::10 setmiterlimit}
+...\special{ps::[] 0 setdash}
+...\hbox(0.0+0.0)x0.0
+....\special{ps::28.34645 14.17323 moveto}
+....\special{ps::28.34645 155.90552 lineto}
+....\special{ps::56.6929 14.17323 moveto}
+....\special{ps::56.6929 155.90552 lineto}
+....\special{ps::85.03934 14.17323 moveto}
+....\special{ps::85.03934 155.90552 lineto}
+....\special{ps::113.38579 14.17323 moveto}
+....\special{ps::113.38579 155.90552 lineto}
+....\special{ps::141.73222 14.17323 moveto}
+....\special{ps::141.73222 155.90552 lineto}
+....\special{ps::14.17323 28.34645 moveto}
+....\special{ps::155.90552 28.34645 lineto}
+....\special{ps::14.17323 56.6929 moveto}
+....\special{ps::155.90552 56.6929 lineto}
+....\special{ps::14.17323 85.03934 moveto}
+....\special{ps::155.90552 85.03934 lineto}
+....\special{ps::14.17323 113.38579 moveto}
+....\special{ps::155.90552 113.38579 lineto}
+....\special{ps::14.17323 141.73222 moveto}
+....\special{ps::155.90552 141.73222 lineto}
+....\special{ps::gsave}
+....\special{ps::color.sc}
+....\special{ps::stroke}
+....\special{ps::grestore}
+....\special{ps::newpath}
+...\special{ps::@endspecial}
+...\special{ps::[end]}
+...\special{color pop}
+! OK.
+<argument> \l_tmpa_box
+l. ... }
============================================================
============================================================
TEST 12: \draw_path_canvas_moveto:n
diff --git a/l3experimental/l3draw/testfiles/m3draw003.xetex.tlg b/l3experimental/l3draw/testfiles/m3draw003.xetex.tlg
index 10c2377bb..cdc6dcfef 100644
--- a/l3experimental/l3draw/testfiles/m3draw003.xetex.tlg
+++ b/l3experimental/l3draw/testfiles/m3draw003.xetex.tlg
@@ -749,6 +749,45 @@ l. ... }
! OK.
<argument> \l_tmpa_box
l. ... }
+> \box...=
+\hbox(142.66377+0.0)x142.66377
+.\hbox(142.66377+0.0)x142.66377
+..\glue -14.02638
+..\hbox(0.0+0.0)x0.0, shifted 14.02638
+...\special{x:gsave}
+...\special{pdf:literal 0.39851 w}
+...\special{pdf:bc [0]}
+...\special{pdf:literal 0 J}
+...\special{pdf:literal 0 j}
+...\special{pdf:literal 10 M}
+...\special{pdf:literal [] 0 d}
+...\hbox(0.0+0.0)x0.0
+....\special{pdf:literal 28.34645 14.17323 m}
+....\special{pdf:literal 28.34645 155.90552 l}
+....\special{pdf:literal 56.6929 14.17323 m}
+....\special{pdf:literal 56.6929 155.90552 l}
+....\special{pdf:literal 85.03934 14.17323 m}
+....\special{pdf:literal 85.03934 155.90552 l}
+....\special{pdf:literal 113.38579 14.17323 m}
+....\special{pdf:literal 113.38579 155.90552 l}
+....\special{pdf:literal 141.73222 14.17323 m}
+....\special{pdf:literal 141.73222 155.90552 l}
+....\special{pdf:literal 14.17323 28.34645 m}
+....\special{pdf:literal 155.90552 28.34645 l}
+....\special{pdf:literal 14.17323 56.6929 m}
+....\special{pdf:literal 155.90552 56.6929 l}
+....\special{pdf:literal 14.17323 85.03934 m}
+....\special{pdf:literal 155.90552 85.03934 l}
+....\special{pdf:literal 14.17323 113.38579 m}
+....\special{pdf:literal 155.90552 113.38579 l}
+....\special{pdf:literal 14.17323 141.73222 m}
+....\special{pdf:literal 155.90552 141.73222 l}
+....\special{pdf:literal S}
+...\special{x:grestore}
+...\special{pdf:ec}
+! OK.
+<argument> \l_tmpa_box
+l. ... }
============================================================
============================================================
TEST 12: \draw_path_canvas_moveto:n
More information about the latex3-commits
mailing list.