Fix issue with large trees
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pierre HUBERT 2023-08-25 19:06:36 +02:00
parent 1c1f2cc710
commit e1bc10e299

View File

@ -33,10 +33,10 @@ export function ComplexFamilyTree(p: {
store,
svg: view.svg,
card_dim: {
w: 230,
h: 70,
text_x: 75,
text_y: 15,
w: 160,
h: 118,
text_x: 5,
text_y: 70,
img_w: 60,
img_h: 60,
img_x: 5,
@ -123,14 +123,20 @@ export function ComplexFamilyTree(p: {
dstSVG = dstSVG.replaceAll("✝", " ");
let womanTiles = getAllIndexes(dstSVG, "card-female");
for (const i of womanTiles) {
let count = 0;
for (let i of womanTiles) {
// Correct padding due to previous corrections
i += count++ * 2;
dstSVG =
dstSVG.substring(0, i) +
dstSVG.substring(i + 1).replace(`fill="white"`, `fill="#ffb6c1"`);
}
count = 0;
let manTiles = getAllIndexes(dstSVG, "card-male");
for (const i of manTiles) {
for (let i of manTiles) {
// Correct padding due to previous corrections
i += count++ * 2;
dstSVG =
dstSVG.substring(0, i) +
dstSVG.substring(i + 1).replace(`fill="white"`, `fill="#add8e6"`);