-- Roots style file
-- Saved by the Roots style editor

--If you edit this by hand, then your changes may be lost when it is next loaded into the style editor

--*MA50B50H100T0C0W30I100S24O0FHomerton.Bold.Oblique
--*PW280H100
--*SFX0Y0W280H100T0O4126536960EcM0
--*SRX0Y0W280H100T0O0EcM0
--*TIMX140Y50S12C16711680EsV1FTrinity.Medium:Tfullname
--*SLX140Y100W140H150T0O0eCM1
--*RW84H100
--*SLX0Y30W84H30T0O0EcM0
--*SLX0Y70W84H70T0O0EcM0
--*SLX42Y30W42H-50T0O0eCM1


gapheightabove=50;
gapheightbelow=50;
personwidth=280;
personheight=100;
gapwidth=100;
marriagewidth=84;
windowborder=30;
titleheight=100;

fontt0=ClaimFont("Homerton.Bold.Oblique",24);
fontp2=ClaimFont("Trinity.Medium",12);

function PersonChanged(person)
w=personwidth;
tx=GetTextDimensions(fontp2,GetField(person,"fullname"));
if tx+12>w then w=tx+12 end
SetWidth(person,w);
end

function RedrawLine(x,y,width,height)
PlotLine(x,y,x+width,y+height,0,0);
end

function RedrawPerson(person,x,y,width,height)
m=width-personwidth;
mh=m/2;
PlotRectangleFilled(x+0,y+0,280+m,100,4126536960);
PlotRectangle(x+0,y+0,280+m,100,0,0);
colour=16711680;
sex=GetField(person,"sex");if sex=="M" then colour=4278190080 end
if sex=="F" then colour=65280 end
text=GetField(person,"fullname");
tx=GetTextDimensions(fontp2,text);
PlotText(x+140+mh-tx/2,y+50,fontp2,4294967040,colour,text)
if GetParentsMarriage(person) then PlotLine(x+140+mh,y+100,x+140+mh,y+150,0,0); end
end

function RedrawMarriage(marriage,x,y,width,height)
m=width-marriagewidth;
mh=m/2;
PlotLine(x+0,y+30,x+84+m,y+30,0,0);
PlotLine(x+0,y+70,x+84+m,y+70,0,0);
if GetChild(marriage) then PlotLine(x+42+mh,y+30,x+42+mh,y+-50,0,0); end
end

function RedrawTitle(title,x,y,width,height)
tx=GetTextDimensions(fontt0,title);
PlotText(x+(width-tx)/2,y+height/2,fontt0,4294967040,0,title);
end

