[Therion] Colour fill problems
Martin Budaj
m.budaj at gmail.com
Fri Jul 23 17:14:52 CEST 2010
On Fri, Jul 23, 2010 at 10:25 AM, Stacho Mudrak <s.m at group-s.sk> wrote:
> It seems to be some kind of bug in PDF export, when exported as SVG, there
> is no such problem.
There is a bug in one MetaPost macro. Scrap's background fill could
sometimes be 0.5 pt smaller on each side of imaginary rectangle arounf
the scrap, producing white strips visible in small scales. Strange
that it was not detected until now. Following code in layout should
fix it.
Martin
code metapost
def draw_downscrap =
bg_name := jobname & "." & decimal(charcode) & "bg";
clip_name := jobname & "." & decimal(charcode) & "clip";
write "%!PS" to bg_name;
write "%%BoundingBox: " &
decimal floor xpart llcorner bgfill & " " &
decimal floor ypart llcorner bgfill & " " &
decimal ceiling xpart urcorner bgfill & " " &
decimal ceiling ypart urcorner bgfill
to bg_name;
write "%%Page: 1 1" to bg_name;
write "newpath" to bg_name;
for qq within bgfill:
q := pathpart qq;
tmp:=length q;
s := decimal(roundone(xpart point tmp of q)) & " "
& decimal(roundone(ypart point tmp of q)) & " m";
write s & "oveto" to bg_name;
write s to clip_name;
for i:=tmp downto 1:
s := decimal(roundone(xpart precontrol i of q)) & " "
& decimal(roundone(ypart precontrol i of q)) & " "
& decimal(roundone(xpart postcontrol i-1 of q)) & " "
& decimal(roundone(ypart postcontrol i-1 of q)) & " "
& decimal(roundone(xpart point i-1 of q)) & " "
& decimal(roundone(ypart point i-1 of q)) & " c";
write s & "urveto" to bg_name;
write s to clip_name;
endfor;
endfor;
write "closepath fill" to bg_name;
write "showpage" to bg_name;
write "%%EOF" to bg_name;
write EOF to bg_name;
write EOF to clip_name;
bgfill:=nullpicture;
enddef;
More information about the Therion
mailing list