summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3experimental/l3draw
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3experimental/l3draw')
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-boxes.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-layers.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-paths.dtx79
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-points.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-scopes.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-softpath.dtx10
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-state.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-transforms.dtx7
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw.dtx18
9 files changed, 84 insertions, 40 deletions
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-boxes.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-boxes.dtx
index 992acaa05c1..fe2207fc1ba 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-boxes.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-boxes.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-layers.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-layers.dtx
index 1244dfa0ec3..bea1d2423c0 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-layers.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-layers.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-paths.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-paths.dtx
index e869351f6bc..0b428cad0f2 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-paths.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-paths.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -192,8 +192,8 @@
% \begin{macrocode}
\cs_new_protected:Npn \draw_path_corner_arc:nn #1#2
{
- \dim_set:Nn \l_@@_corner_xarc_dim {#1}
- \dim_set:Nn \l_@@_corner_yarc_dim {#2}
+ \dim_set:Nn \l_@@_corner_xarc_dim { \fp_to_dim:n {#1} }
+ \dim_set:Nn \l_@@_corner_yarc_dim { \fp_to_dim:n {#2} }
\bool_lazy_and:nnTF
{ \dim_compare_p:nNn \l_@@_corner_xarc_dim = { 0pt } }
{ \dim_compare_p:nNn \l_@@_corner_yarc_dim = { 0pt } }
@@ -700,16 +700,18 @@
% \begin{macrocode}
\cs_new_protected:Npn \draw_path_rectangle:nn #1#2
{
- \@@_point_process:nnn
+ \bool_lazy_or:nnTF
+ { \l_@@_corner_arc_bool }
+ { \l_@@_matrix_active_bool }
{
- \bool_lazy_or:nnTF
- { \l_@@_corner_arc_bool }
- { \l_@@_matrix_active_bool }
- { \@@_path_rectangle_rounded:nnnn }
- { \@@_path_rectangle:nnnn }
+ \@@_point_process:nnn \@@_path_rectangle_rounded:nnnn
+ {#1} {#2}
+ }
+ {
+ \@@_point_process:nnn \@@_path_rectangle:nnnn
+ { (#1) + ( \l_@@_xshift_dim , \l_@@_yshift_dim ) }
+ { #2 }
}
- {#1}
- {#2}
}
\cs_new_protected:Npn \@@_path_rectangle:nnnn #1#2#3#4
{
@@ -766,8 +768,8 @@
\@@_point_process:nnn
{
\@@_path_grid_auxi:eennnn
- { \dim_eval:n { \dim_abs:n {#1} } }
- { \dim_eval:n { \dim_abs:n {#2} } }
+ { \dim_abs:n {#1} }
+ { \dim_abs:n {#2} }
}
{#3} {#4}
}
@@ -787,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
@@ -832,19 +834,20 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_@@_path_use_bb_bool, \l_@@_path_use_clear_bool}
+% \begin{variable}{\l_@@_path_use_clear_bool}
% Actions handled at the macro layer.
% \begin{macrocode}
-\bool_new:N \l_@@_path_use_bb_bool
\bool_new:N \l_@@_path_use_clear_bool
% \end{macrocode}
% \end{variable}
%
% \begin{macro}{\draw_path_use:n, \draw_path_use_clear:n}
+% \begin{macro}{\draw_path_replace_bb:}
+% \begin{macro}{\@@_path_replace_bb:NnN}
% \begin{macro}{\@@_path_use:n}
% \begin{macro}{\@@_path_use_action_draw:, \@@_path_use_action_fillstroke:}
% \begin{macro}{\@@_path_use_stroke_bb:}
-% \begin{macro}{\@@_path_use_stroke_bb_aux:NnN}
+% \begin{macro}{\@@_path_use_bb:NnN}
% There are a range of actions which can apply to a path: they are handled
% in a single function which can carry out several of them. The first step
% is to deal with the special case of clearing the path.
@@ -865,6 +868,23 @@
}
{ \@@_path_use:n { #1 , clear } }
}
+\cs_new_protected:Npn \draw_path_replace_bb:
+ {
+ \@@_path_replace_bb:NnN x { max } +
+ \@@_path_replace_bb:NnN y { max } +
+ \@@_path_replace_bb:NnN x { min } -
+ \@@_path_replace_bb:NnN y { min } -
+ \@@_softpath_clear:
+ \@@_path_reset_limits:
+ }
+\cs_new_protected:Npn \@@_path_replace_bb:NnN #1#2#3
+ {
+ \dim_gset:cn { g_@@_ #1#2 _dim }
+ {
+ \dim_use:c { g_@@_path_ #1#2 _dim }
+ #3 0.5 \g_@@_linewidth_dim
+ }
+ }
% \end{macrocode}
% Map over the actions and set up the data: mainly just booleans,
% but with the possibility to cover more complex cases. The business end
@@ -913,7 +933,10 @@
}
}
\bool_if:NT \l_@@_path_use_clear_bool
- { \@@_softpath_clear: }
+ {
+ \@@_softpath_clear:
+ \@@_path_reset_limits:
+ }
}
\cs_new_protected:Npn \@@_path_use_action_draw:
{
@@ -930,12 +953,12 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_path_use_stroke_bb:
{
- \@@_path_use_stroke_bb_aux:NnN x { max } +
- \@@_path_use_stroke_bb_aux:NnN y { max } +
- \@@_path_use_stroke_bb_aux:NnN x { min } -
- \@@_path_use_stroke_bb_aux:NnN y { min } -
+ \@@_path_use_bb:NnN x { max } +
+ \@@_path_use_bb:NnN y { max } +
+ \@@_path_use_bb:NnN x { min } -
+ \@@_path_use_bb:NnN y { min } -
}
-\cs_new_protected:Npn \@@_path_use_stroke_bb_aux:NnN #1#2#3
+\cs_new_protected:Npn \@@_path_use_bb:NnN #1#2#3
{
\dim_compare:nNnF { \dim_use:c { g_@@_ #1#2 _dim } } = { #3 -\c_max_dim }
{
@@ -956,6 +979,8 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsection{Scoping paths}
%
@@ -1017,11 +1042,13 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macrocode}
+% \subsection{Messages}
+%
+% \begin{macrocode}
\msg_new:nnnn { draw } { invalid-path-action }
{ Invalid~action~'#1'~for~path. }
{ Paths~can~be~used~with~actions~'draw',~'clip',~'fill'~or~'stroke'. }
-% \end{macrocode}
+% \end{macrocode}
%
% \begin{macrocode}
%</package>
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-points.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-points.dtx
index 0cb0fd65079..919f0734402 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-points.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-points.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-scopes.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-scopes.dtx
index 56ce949b240..81ab2dfed29 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-scopes.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-scopes.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-softpath.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-softpath.dtx
index c929e86aa7a..0d5d6d8b6b9 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-softpath.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-softpath.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -163,6 +163,7 @@
% \end{macrocode}
% \end{variable}
%
+% \begin{macro}{\@@_softpath_closepath:}
% \begin{macro}{\@@_softpath_curveto:nnnnnn}
% \begin{macro}
% {
@@ -227,6 +228,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}
% {
@@ -260,12 +262,14 @@
{ \@@_backend_lineto:nn {#1} {#2} }
\cs_new_protected:Npn \@@_softpath_moveto_op:nn #1#2
{ \@@_backend_moveto:nn {#1} {#2} }
-\cs_new_protected:Npn \@@_softpath_roundpoint_op:nn #1#2 { }
+\cs_new_protected:Npn \@@_softpath_roundpoint_op:nn #1#2
+ { \@@_softpath_roundpoint_op:nn }
\cs_new_protected:Npn \@@_softpath_rectangle_opi:nn #1#2
{ \@@_softpath_rectangle_opi:nnNnn {#1} {#2} }
\cs_new_protected:Npn \@@_softpath_rectangle_opi:nnNnn #1#2#3#4#5
{ \@@_backend_rectangle:nnnn {#1} {#2} {#4} {#5} }
- \cs_new_protected:Npn \@@_softpath_rectangle_opii:nn #1#2 { }
+\cs_new_protected:Npn \@@_softpath_rectangle_opii:nn #1#2
+ { \@@_softpath_rectangle_opii:nn }
% \end{macrocode}
% \end{macro}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-state.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-state.dtx
index aef5c2111d7..989c10fc2d0 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-state.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-state.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-transforms.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-transforms.dtx
index 8e9143420ed..411bf309280 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-transforms.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-transforms.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -114,6 +114,7 @@
\fp_zero:N \l_@@_matrix_b_fp
\fp_zero:N \l_@@_matrix_c_fp
\fp_set:Nn \l_@@_matrix_d_fp { 1 }
+ \bool_set_false:N \l_@@_matrix_active_bool
}
\cs_new_protected:Npn \draw_transform_shift_reset:
{
@@ -219,7 +220,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 +228,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/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw.dtx
index 2bfa4e00af2..a884b922b22 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw.dtx
@@ -110,7 +110,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -583,7 +583,7 @@
%
% \begin{function}{\draw_path_corner_arc:nn}
% \begin{syntax}
-% \cs{draw_path_corner_arc:n} \Arg{length1} \Arg{length2}
+% \cs{draw_path_corner_arc:nn} \Arg{length1} \Arg{length2}
% \end{syntax}
% Sets the degree of rounding applied to corners in a path: the two
% \meta{length} values are the distances from the corner at which the curving
@@ -658,6 +658,18 @@
% at the macro level).
% \end{function}
%
+% \begin{function}{\draw_path_replace_bb:}
+% \begin{syntax}
+% \cs{draw_path_replace_bb:}
+% \end{syntax}
+% Replaces the current bounding box of the drawing with one specified by the
+% current path: this will be applied even when \cs{l_draw_bb_update_bool}
+% is \texttt{false}. The current path is then cleared. Note that
+% \cs{l_draw_bb_update_bool} is \emph{not} changed by this function:
+% the user may wish to set it to \texttt{false} so that the bounding box
+% is then left unchanged by further operations.
+% \end{function}
+%
% \subsubsection{Path operations on drawing axes}
%
% The standard path functions are all influenced by the active transformation
@@ -1181,7 +1193,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{l3draw}{2024-02-20}{}
+\ProvidesExplPackage{l3draw}{2024-03-14}{}
{L3 Experimental core drawing support}
% \end{macrocode}
%