diff --git a/experiments/modern/src/App.js b/experiments/modern/src/App.js index dace47d4..f39d7ff2 100644 --- a/experiments/modern/src/App.js +++ b/experiments/modern/src/App.js @@ -150,13 +150,20 @@ function Layer({ id, image, children, x, y }) { console.warn("Unable to find image to render. Rendering null", image); return null; } + const params = {}; + if (x !== undefined) { + params.left = Number(x); + } + if (y !== undefined) { + params.top = Number(y); + } return ( <> {children} @@ -166,7 +173,7 @@ function Layer({ id, image, children, x, y }) { function Button({ id, image, action, x, y, downImage, tooltip, children }) { const data = React.useContext(SkinContext); const [down, setDown] = React.useState(false); - const imgId = down ? downImage : image; + const imgId = down && downImage ? downImage : image; if (imgId == null) { console.warn("Got a Button without a imgId. Rendering null", id); return null; @@ -195,7 +202,7 @@ function Button({ id, image, action, x, y, downImage, tooltip, children }) { top: Number(y), left: Number(x), backgroundPositionX: -Number(img.x), - backgroundPositionx: -Number(img.y), + backgroundPositionY: -Number(img.y), width: Number(img.w), height: Number(img.h), backgroundImage: `url(${img.imgUrl})`,