MCPcopy Index your code
hub / github.com/cifertech/DisplayKit / getImageDimsForElement

Function getImageDimsForElement

app.js:4993–4999  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

4991}
4992
4993function getImageDimsForElement(el) {
4994 if (!el) return null;
4995 if (el.imageWidth && el.imageHeight) return { w: el.imageWidth, h: el.imageHeight };
4996 const a = getAssetById(el.assetId);
4997 if (a && a.width && a.height) return { w: a.width, h: a.height };
4998 return null;
4999}
5000
5001function getSelectionBoundsPx(ids) {
5002 const sels = (ids && ids.length ? ids : (selectedIds && selectedIds.size ? Array.from(selectedIds) : [])).map((id) => elements.find((e) => e.id === id)).filter(Boolean);

Callers 2

generateTFTCodeFunction · 0.85
generateU8g2CodeFunction · 0.85

Calls 1

getAssetByIdFunction · 0.85

Tested by

no test coverage detected