diff options
Diffstat (limited to 'metapost/context/base/mpiv/mp-shap.mpiv')
-rw-r--r-- | metapost/context/base/mpiv/mp-shap.mpiv | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/metapost/context/base/mpiv/mp-shap.mpiv b/metapost/context/base/mpiv/mp-shap.mpiv index 713656510..a511ef375 100644 --- a/metapost/context/base/mpiv/mp-shap.mpiv +++ b/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 ; |