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

--*MA50B50H100T0C0W30I100S24O0FHomerton.Bold.Oblique
--*PW280H100
--*TIMX140Y50S12C0ExV1FTrinity.Medium:Tfullname
--*SLX140Y100W140H150T0O0eCM1
--*RW84H100
--*SLX0Y30W84H30T0O0EcM0
--*SLX0Y70W84H70T0O0EcM0
--*SLX42Y30W42H-50T0O0eCM1
--*TIMX42Y80S12C0exV1FTrinity.Medium:Tdate


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

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

function PersonChanged(person)
w=personwidth;
tx=GetTextDimensions(fontp0,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;
colour=0;
text=GetField(person,"fullname");
tx=GetTextDimensions(fontp0,text);
PlotText(x+140+mh-tx/2,y+50,fontp0,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
colour=0;
text=GetField(marriage,"date");
tx=GetTextDimensions(fontm3,text);
PlotText(x+42+mh-tx/2,y+80,fontm3,4294967040,colour,text)
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

