diff options
Diffstat (limited to 'metapost/context/mp-spec.mp')
-rw-r--r-- | metapost/context/mp-spec.mp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/metapost/context/mp-spec.mp b/metapost/context/mp-spec.mp index 93a36a4eb..05f5cecad 100644 --- a/metapost/context/mp-spec.mp +++ b/metapost/context/mp-spec.mp @@ -158,17 +158,19 @@ fi ; newinternal shadefactor ; shadefactor := 1 ; +pair shadeoffset ; shadeoffset := origin ; + vardef define_linear_shade (expr a, b, ca, cb) = flush_special(30, 15, "0 1 " & decimal shadefactor & " " & - dddecimal ca & ddecimal a & - dddecimal cb & ddecimal b ) ; + dddecimal ca & ddecimal (a shifted shadeoffset) & + dddecimal cb & ddecimal (b shifted shadeoffset) ) ; _special_counter_ enddef ; vardef define_circular_shade (expr a, b, ra, rb, ca, cb) = flush_special(31, 17, "0 1 " & decimal shadefactor & " " & - dddecimal ca & ddecimal a & " " & decimal ra & - dddecimal cb & ddecimal b & " " & decimal rb ) ; + dddecimal ca & ddecimal (a shifted shadeoffset) & " " & decimal ra & + dddecimal cb & ddecimal (b shifted shadeoffset) & " " & decimal rb ) ; _special_counter_ enddef ; |