diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty | 76 |
1 files changed, 50 insertions, 26 deletions
diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty b/Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty index a38d6f149d1..901aea3d8c2 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty @@ -29,7 +29,7 @@ %% File: l3draw.dtx \RequirePackage{expl3} -\ProvidesExplPackage{l3draw}{2024-02-20}{} +\ProvidesExplPackage{l3draw}{2024-03-14}{} {L3 Experimental core drawing support} \scan_new:N \s__draw_mark \scan_new:N \s__draw_stop @@ -262,8 +262,8 @@ \bool_new:N \l__draw_corner_arc_bool \cs_new_protected:Npn \draw_path_corner_arc:nn #1#2 { - \dim_set:Nn \l__draw_corner_xarc_dim {#1} - \dim_set:Nn \l__draw_corner_yarc_dim {#2} + \dim_set:Nn \l__draw_corner_xarc_dim { \fp_to_dim:n {#1} } + \dim_set:Nn \l__draw_corner_yarc_dim { \fp_to_dim:n {#2} } \bool_lazy_and:nnTF { \dim_compare_p:nNn \l__draw_corner_xarc_dim = { 0pt } } { \dim_compare_p:nNn \l__draw_corner_yarc_dim = { 0pt } } @@ -597,16 +597,18 @@ { \draw_path_ellipse:nnn {#1} { #2 , 0pt } { 0pt , #2 } } \cs_new_protected:Npn \draw_path_rectangle:nn #1#2 { - \__draw_point_process:nnn + \bool_lazy_or:nnTF + { \l__draw_corner_arc_bool } + { \l__draw_matrix_active_bool } { - \bool_lazy_or:nnTF - { \l__draw_corner_arc_bool } - { \l__draw_matrix_active_bool } - { \__draw_path_rectangle_rounded:nnnn } - { \__draw_path_rectangle:nnnn } + \__draw_point_process:nnn \__draw_path_rectangle_rounded:nnnn + {#1} {#2} + } + { + \__draw_point_process:nnn \__draw_path_rectangle:nnnn + { (#1) + ( \l__draw_xshift_dim , \l__draw_yshift_dim ) } + { #2 } } - {#1} - {#2} } \cs_new_protected:Npn \__draw_path_rectangle:nnnn #1#2#3#4 { @@ -637,8 +639,8 @@ \__draw_point_process:nnn { \__draw_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} } @@ -658,8 +660,8 @@ \cs_new_protected:Npn \__draw_path_grid_auxiii:nnnnnn #1#2#3#4#5#6 { \__draw_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 \__draw_path_grid_auxiv:nnnnnnnn #1#2#3#4#5#6#7#8 @@ -685,7 +687,6 @@ \bool_new:N \l__draw_path_use_clip_bool \bool_new:N \l__draw_path_use_fill_bool \bool_new:N \l__draw_path_use_stroke_bool -\bool_new:N \l__draw_path_use_bb_bool \bool_new:N \l__draw_path_use_clear_bool \cs_new_protected:Npn \draw_path_use:n #1 { @@ -703,6 +704,23 @@ } { \__draw_path_use:n { #1 , clear } } } +\cs_new_protected:Npn \draw_path_replace_bb: + { + \__draw_path_replace_bb:NnN x { max } + + \__draw_path_replace_bb:NnN y { max } + + \__draw_path_replace_bb:NnN x { min } - + \__draw_path_replace_bb:NnN y { min } - + \__draw_softpath_clear: + \__draw_path_reset_limits: + } +\cs_new_protected:Npn \__draw_path_replace_bb:NnN #1#2#3 + { + \dim_gset:cn { g__draw_ #1#2 _dim } + { + \dim_use:c { g__draw_path_ #1#2 _dim } + #3 0.5 \g__draw_linewidth_dim + } + } \cs_new_protected:Npn \__draw_path_use:n #1 { \bool_set_false:N \l__draw_path_use_clip_bool @@ -745,7 +763,10 @@ } } \bool_if:NT \l__draw_path_use_clear_bool - { \__draw_softpath_clear: } + { + \__draw_softpath_clear: + \__draw_path_reset_limits: + } } \cs_new_protected:Npn \__draw_path_use_action_draw: { @@ -758,12 +779,12 @@ } \cs_new_protected:Npn \__draw_path_use_stroke_bb: { - \__draw_path_use_stroke_bb_aux:NnN x { max } + - \__draw_path_use_stroke_bb_aux:NnN y { max } + - \__draw_path_use_stroke_bb_aux:NnN x { min } - - \__draw_path_use_stroke_bb_aux:NnN y { min } - + \__draw_path_use_bb:NnN x { max } + + \__draw_path_use_bb:NnN y { max } + + \__draw_path_use_bb:NnN x { min } - + \__draw_path_use_bb:NnN y { min } - } -\cs_new_protected:Npn \__draw_path_use_stroke_bb_aux:NnN #1#2#3 +\cs_new_protected:Npn \__draw_path_use_bb:NnN #1#2#3 { \dim_compare:nNnF { \dim_use:c { g__draw_ #1#2 _dim } } = { #3 -\c_max_dim } { @@ -1540,12 +1561,14 @@ { \__draw_backend_lineto:nn {#1} {#2} } \cs_new_protected:Npn \__draw_softpath_moveto_op:nn #1#2 { \__draw_backend_moveto:nn {#1} {#2} } -\cs_new_protected:Npn \__draw_softpath_roundpoint_op:nn #1#2 { } +\cs_new_protected:Npn \__draw_softpath_roundpoint_op:nn #1#2 + { \__draw_softpath_roundpoint_op:nn } \cs_new_protected:Npn \__draw_softpath_rectangle_opi:nn #1#2 { \__draw_softpath_rectangle_opi:nnNnn {#1} {#2} } \cs_new_protected:Npn \__draw_softpath_rectangle_opi:nnNnn #1#2#3#4#5 { \__draw_backend_rectangle:nnnn {#1} {#2} {#4} {#5} } - \cs_new_protected:Npn \__draw_softpath_rectangle_opii:nn #1#2 { } +\cs_new_protected:Npn \__draw_softpath_rectangle_opii:nn #1#2 + { \__draw_softpath_rectangle_opii:nn } \tl_new:N \l__draw_softpath_main_tl \tl_new:N \l__draw_softpath_part_tl \tl_new:N \l__draw_softpath_curve_end_tl @@ -1826,6 +1849,7 @@ \fp_zero:N \l__draw_matrix_b_fp \fp_zero:N \l__draw_matrix_c_fp \fp_set:Nn \l__draw_matrix_d_fp { 1 } + \bool_set_false:N \l__draw_matrix_active_bool } \cs_new_protected:Npn \draw_transform_shift_reset: { @@ -1898,7 +1922,7 @@ \fp_to_dim:n { #1 + - ( #3 * \l__draw_matrix_a_fp + #4 * \l__draw_matrix_b_fp ) + ( #3 * \l__draw_matrix_a_fp + #4 * \l__draw_matrix_c_fp ) } } \dim_set:Nn \l__draw_yshift_dim @@ -1906,7 +1930,7 @@ \fp_to_dim:n { #2 + - ( #3 * \l__draw_matrix_c_fp + #4 * \l__draw_matrix_d_fp ) + ( #3 * \l__draw_matrix_b_fp + #4 * \l__draw_matrix_d_fp ) } } } |