diff options
author | Karl Berry <karl@freefriends.org> | 2018-05-06 21:49:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-05-06 21:49:18 +0000 |
commit | 905323115107c182a860bca6a036889f4fc7f36f (patch) | |
tree | 6c869d6ae5c9e922ab2e2d5e490ff94a21c0eba5 /Master/texmf-dist/tex/latex/l3experimental/l3draw | |
parent | f050c0a04305c67056475697fe6f1131c2b4bc9e (diff) |
l3experimental
git-svn-id: svn://tug.org/texlive/trunk@47633 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3experimental/l3draw')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty | 106 |
1 files changed, 35 insertions, 71 deletions
diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty b/Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty index 7375cf33197..f991619ccc9 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty @@ -27,7 +27,7 @@ %% %% File: l3draw.dtx Copyright(C) 2018 The LaTeX3 Project \RequirePackage{expl3} -\ProvidesExplPackage{l3draw}{2018/03/05}{} +\ProvidesExplPackage{l3draw}{2018-04-30}{} {L3 Experimental core drawing support} \RequirePackage { l3color } %% File: l3draw-boxes.dtx Copyright(C) 2018 The LaTeX3 Project @@ -680,8 +680,7 @@ \dim_set_eq:NN \l__draw_softpath_lastx_dim \g__draw_softpath_lastx_dim \dim_set_eq:NN \l__draw_softpath_lasty_dim \g__draw_softpath_lasty_dim \__draw_path_reset_limits: - \__draw_softpath_concat:n { } - \tl_set_eq:NN \l__draw_softpath_main_tl \g__draw_softpath_main_tl + \tl_build_get:NN \g__draw_softpath_main_tl \l__draw_softpath_main_tl \bool_set_eq:NN \l__draw_softpath_corners_bool \g__draw_softpath_corners_bool @@ -689,11 +688,11 @@ } \cs_new_protected:Npn \draw_path_scope_end: { + \__draw_softpath_clear: \bool_gset_eq:NN \g__draw_softpath_corners_bool \l__draw_softpath_corners_bool - \__draw_softpath_clear: - \tl_gset_eq:NN \g__draw_softpath_main_tl \l__draw_softpath_main_tl + \__draw_softpath_add:o \l__draw_softpath_main_tl \dim_gset_eq:NN \g__draw_softpath_lastx_dim \l__draw_softpath_lastx_dim \dim_gset_eq:NN \g__draw_softpath_lasty_dim \l__draw_softpath_lasty_dim \dim_gset_eq:NN \g__draw_path_xmax_dim \l__draw_path_xmax_dim @@ -734,8 +733,6 @@ { \__draw_point_to_dim_aux:w #1 } \cs_generate_variant:Nn \__draw_point_to_dim_aux:n { f } \cs_new:Npn \__draw_point_to_dim_aux:w ( #1 , ~ #2 ) { #1pt , #2pt } -\cs_new:Npn \draw_point:nn #1#2 - { \__draw_point_to_dim:n { #1 , #2 } } \cs_new:Npn \draw_point_polar:nn #1#2 { \draw_point_polar:nnn {#1} {#2} {#2} } \cs_new:Npn \draw_point_polar:nnn #1#2#3 @@ -743,12 +740,6 @@ \cs_new:Npn \__draw_draw_polar:nnn #1#2#3 { \__draw_point_to_dim:n { cosd(#1) * (#2) , sind(#1) * (#3) } } \cs_generate_variant:Nn \__draw_draw_polar:nnn { f } -\cs_new:Npn \draw_point_add:nn #1#2 - { \__draw_point_to_dim:n { (#1) + (#2) } } -\cs_new:Npn \draw_point_diff:nn #1#2 - { \__draw_point_to_dim:n { (#2) - (#1) } } -\cs_new:Npn \draw_point_scale:nn #1#2 - { \__draw_point_to_dim:n { #1 * (#2) } } \cs_new:Npn \draw_point_unit_vector:n #1 { \__draw_point_process:nn { \__draw_point_unit_vector:nn } {#1} } \cs_new:Npn \__draw_point_unit_vector:nn #1#2 @@ -1126,6 +1117,11 @@ \__draw_softpath_clear: \draw_linewidth:n { \l_draw_default_linewidth_dim } \draw_color:n { . } + \draw_nonzero_rule: + \draw_cap_butt: + \draw_join_miter: + \draw_miterlimit:n { 10 } + \draw_dash_pattern:nn { } { 0cm } } \cs_new_protected:Npn \draw_end: { @@ -1205,64 +1201,19 @@ } %% File: l3draw-softpath.dtx Copyright(C) 2018 The LaTeX3 Project \tl_new:N \g__draw_softpath_main_tl -\tl_new:N \g__draw_softpath_buffer_a_tl -\tl_new:N \g__draw_softpath_buffer_b_tl -\int_new:N \g__draw_softpath_buffer_a_int -\int_new:N \g__draw_softpath_buffer_b_int +\tl_new:N \l__draw_softpath_internal_tl \bool_new:N \g__draw_softpath_corners_bool -\cs_new_protected:Npn \__draw_softpath_add:n #1 - { - \int_compare:nNnTF \g__draw_softpath_buffer_a_int < { 40 } - { - \int_gincr:N \g__draw_softpath_buffer_a_int - \tl_gput_right:Nn \g__draw_softpath_buffer_a_tl {#1} - } - { - \int_compare:nNnTF \g__draw_softpath_buffer_b_int < { 40 } - { - \int_gincr:N \g__draw_softpath_buffer_b_int - \tl_gset:Nx \g__draw_softpath_buffer_b_tl - { - \exp_not:V \g__draw_softpath_buffer_b_tl - \exp_not:V \g__draw_softpath_buffer_a_tl - \exp_not:n {#1} - } - \int_gzero:N \g__draw_softpath_buffer_a_int - \tl_gclear:N \g__draw_softpath_buffer_a_tl - } - { \__draw_softpath_concat:n {#1} } - } - } -\cs_generate_variant:Nn \__draw_softpath_add:n { x } -\cs_new_protected:Npn \__draw_softpath_concat:n #1 - { - \tl_gset:Nx \g__draw_softpath_main_tl - { - \exp_not:V \g__draw_softpath_main_tl - \exp_not:V \g__draw_softpath_buffer_b_tl - \exp_not:V \g__draw_softpath_buffer_a_tl - \exp_not:n {#1} - } - \__draw_softpath_reset_buffers: - } -\cs_new_protected:Npn \__draw_softpath_reset_buffers: - { - \int_gzero:N \g__draw_softpath_buffer_a_int - \tl_gclear:N \g__draw_softpath_buffer_a_tl - \int_gzero:N \g__draw_softpath_buffer_b_int - \tl_gclear:N \g__draw_softpath_buffer_b_tl - } +\cs_new_protected:Npn \__draw_softpath_add:n + { \tl_build_gput_right:Nn \g__draw_softpath_main_tl } +\cs_generate_variant:Nn \__draw_softpath_add:n { o, x } \cs_new_protected:Npn \__draw_softpath_use: { - \g__draw_softpath_main_tl - \g__draw_softpath_buffer_b_tl - \g__draw_softpath_buffer_a_tl + \tl_build_get:NN \g__draw_softpath_main_tl \l__draw_softpath_internal_tl + \l__draw_softpath_internal_tl } \cs_new_protected:Npn \__draw_softpath_clear: { - \tl_gclear:N \g__draw_softpath_main_tl - \tl_gclear:N \g__draw_softpath_buffer_a_tl - \tl_gclear:N \g__draw_softpath_buffer_b_tl + \tl_build_gclear:N \g__draw_softpath_main_tl \bool_gset_false:N \g__draw_softpath_corners_bool } \cs_new_protected:Npn \__draw_softpath_use_clear: @@ -1363,9 +1314,9 @@ \fp_zero:N \l__draw_softpath_lasty_fp \tl_clear:N \l__draw_softpath_first_tl \tl_clear:N \l__draw_softpath_move_tl - \__draw_softpath_concat:n { } + \tl_build_get:NN \g__draw_softpath_main_tl \l__draw_softpath_internal_tl \exp_after:wN \__draw_softpath_round_loop:Nnn - \g__draw_softpath_main_tl + \l__draw_softpath_internal_tl \q_recursion_tail ? ? \q_recursion_stop \group_end: @@ -1569,11 +1520,11 @@ \l__draw_softpath_move_tl \tl_put_right:No \l__draw_softpath_main_tl \l__draw_softpath_part_tl - \tl_gset_eq:NN \g__draw_softpath_main_tl \l__draw_softpath_main_tl + \tl_build_gclear:N \g__draw_softpath_main_tl + \__draw_softpath_add:o \l__draw_softpath_main_tl } %% File: l3draw-state.dtx Copyright(C) 2018 The LaTeX3 Project \dim_new:N \g__draw_linewidth_dim -\dim_new:N \g__draw_inner_linewidth_dim \dim_new:N \l_draw_default_linewidth_dim \dim_set:Nn \l_draw_default_linewidth_dim { 0.4pt } \cs_new_protected:Npn \draw_linewidth:n #1 @@ -1581,8 +1532,21 @@ \dim_gset:Nn \g__draw_linewidth_dim { \fp_to_dim:n {#1} } \driver_draw_linewidth:n \g__draw_linewidth_dim } -\cs_new_protected:Npn \draw_inner_linewidth:n #1 - { \dim_gset:Nn \g__draw_inner_linewidth_dim { \fp_to_dim:n {#1} } } +\cs_new_protected:Npn \draw_dash_pattern:nn #1#2 + { + \group_begin: + \seq_set_from_clist:Nn \l__draw_tmp_seq {#1} + \seq_set_map:NNn \l__draw_tmp_seq \l__draw_tmp_seq + { \fp_to_dim:n {##1} } + \use:x + { + \driver_draw_dash_pattern:nn + { \seq_use:Nn \l__draw_tmp_seq { , } } + { \fp_to_dim:n {#2} } + } + \group_end: + } +\seq_new:N \l__draw_tmp_seq \cs_new_protected:Npn \draw_miterlimit:n #1 { \driver_draw_miterlimit:n { \fp_eval:n {#1} } } \cs_new_protected:Npn \draw_cap_butt: { \driver_draw_cap_butt: } |