Add special transform for building 4, mapsheet 1
This commit is contained in:
@@ -624,14 +624,28 @@ sheets = msGrps.map(msG => {
|
||||
buildings: [...buildings].map(bld => {
|
||||
const bldId = bld.getAttributeNS(null, 'class');
|
||||
const bldDef = document.querySelector(`defs #${bldId}`);
|
||||
// Map-specific footprint definition override
|
||||
const footprint = bld.querySelector('.footprint') ? bld.querySelectorAll('.footprint g') : bldDef.querySelectorAll('.footprint g');
|
||||
|
||||
const grid = [...bldDef.querySelectorAll('.footprint g')].reduce((acc, coordEl) => {
|
||||
const grid = [...footprint].reduce((acc, coordEl) => {
|
||||
acc = generateRadialCoords(acc, toRad(coordEl.dataset), toRect(coordEl.dataset), coordEl.dataset.offset);
|
||||
return acc;
|
||||
}, new Map());
|
||||
|
||||
const { q: dq, r: dr, s: ds } = toRad(bld.dataset);
|
||||
const position = bld.dataset.rotate ? rotate180({ q: +dq, r: +dr, s: +ds }) : ({ q, r, s }) => ({ q: q + +dq, r: r + +dr, s: s + +ds });
|
||||
let position // = bld.dataset.rotate ? rotate180({ q: +dq, r: +dr, s: +ds }) : ({ q, r, s }) => ({ q: q + +dq, r: r + +dr, s: s + +ds });
|
||||
|
||||
if (bld.dataset.rotate)
|
||||
position = rotate180({ q: +dq, r: +dr, s: +ds });
|
||||
else if (bld.dataset.transform)
|
||||
position = ({ q, r, s }) => ({
|
||||
q: q + +dq,
|
||||
r: r + +dr,
|
||||
s: s + +ds,
|
||||
transform: (x, y) => `translate(${x + horzSpacing}, ${y})`
|
||||
})
|
||||
else
|
||||
position = ({ q, r, s }) => ({ q: q + +dq, r: r + +dr, s: s + +ds });
|
||||
|
||||
return {
|
||||
type: bld.getAttributeNS(null, 'class'),
|
||||
|
||||
Reference in New Issue
Block a user