diff options
author | Karl Berry <karl@freefriends.org> | 2017-04-19 23:04:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-04-19 23:04:15 +0000 |
commit | f74161ca4e7eb3c5af9afcbe92522ae3b58987c1 (patch) | |
tree | 3c30a13df5ac7968195c85070a2b074578e669d2 /Master/texmf-dist/metapost/context/base/mpiv/mp-shap.mpiv | |
parent | 1d5a55ac8f5506a7ae9cfca52f4b588182e199d4 (diff) |
context beta/cont-tmf.zip (Apr 16 12:55)
git-svn-id: svn://tug.org/texlive/trunk@43931 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/metapost/context/base/mpiv/mp-shap.mpiv')
-rw-r--r-- | Master/texmf-dist/metapost/context/base/mpiv/mp-shap.mpiv | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Master/texmf-dist/metapost/context/base/mpiv/mp-shap.mpiv b/Master/texmf-dist/metapost/context/base/mpiv/mp-shap.mpiv index 7136565108d..a511ef37523 100644 --- a/Master/texmf-dist/metapost/context/base/mpiv/mp-shap.mpiv +++ b/Master/texmf-dist/metapost/context/base/mpiv/mp-shap.mpiv @@ -74,6 +74,8 @@ def stop_predefined_shape_definition = enddef ; +% this can be delayed + start_predefined_shape_definition ; predefined_shapes[ 0] := (origin--cycle) ; @@ -143,7 +145,7 @@ start_predefined_shape_definition ; stop_predefined_shape_definition ; vardef some_shape_path (expr type) = - if known predefined_shapes[type] : predefined_shapes[type] else : predefined_shapes[0] fi + if known predefined_shapes[type] : predefined_shapes[type] else : predefined_shapes[24] fi enddef ; def some_shape (expr shape_type, shape_width, shape_height, shape_linewidth, shape_linecolor, shape_fillcolor) = @@ -156,14 +158,22 @@ def some_shape (expr shape_type, shape_width, shape_height, shape_linewidth, sha endgroup ; enddef ; +% maybe: +% +% if t>1 : % normal shape +% path pp ; pp := some_shape_path(t) xyscaled(bbwidth(p), bbheight(p)) ; +% pp := pp shifted - center pp shifted center p ; +% fill pp withcolor fc ; +% draw pp withpen pencircle scaled lw withcolor lc ; + vardef drawpredefinedshape (expr t, p, lw, lc, fc) = save pp ; - if t>1 : % normal shape + if t > 1 : % normal shape path pp ; pp := some_shape_path(t) xyscaled(bbwidth(p), bbheight(p)) shifted center p ; fill pp withcolor fc ; draw pp withpen pencircle scaled lw withcolor lc ; - elseif t=1 : % background only + elseif t = 1 : % background only path pp ; pp := fullsquare xyscaled(bbwidth(p), bbheight(p)) shifted center p ; fill pp withcolor fc ; |