diff --git a/app/react-components/devtools.jsx b/app/react-components/devtools.jsx index ebc2548..4e3a1eb 100644 --- a/app/react-components/devtools.jsx +++ b/app/react-components/devtools.jsx @@ -24,21 +24,22 @@ export default function Devtools({ - - - - Apply filters - { - setApplyFilters(!applyFilters); - }} - type="checkbox" - /> - - - - + + + + + Apply filters + { + setApplyFilters(!applyFilters); + }} + type="checkbox" + /> + + + + diff --git a/app/react-components/devtools.module.css b/app/react-components/devtools.module.css index a671109..2f2f4ac 100644 --- a/app/react-components/devtools.module.css +++ b/app/react-components/devtools.module.css @@ -9,15 +9,41 @@ color: white; height: 100%; overflow: hidden; - padding: 16px; width: 100%; } +.devtools form { + label { + font-weight: bold; + :first-child { + margin-right: 4px; + } + } + input, select, option { + background-color: #333333; + color: #ffffff; + } +} + .devtools > :global(.react-tabs) { display: flex; flex-direction: column; height: 100%; + > :global(.react-tabs__tab-list) { + margin-bottom: 0; + } > :global(.react-tabs__tab-panel) { overflow-y: auto; } -} \ No newline at end of file + :global(.react-tabs__tab--selected) { + background-color: #00000022; + color: #ffffff; + } + :global(.react-tabs__tab:focus:after) { + background-color: #00000044; + } +} + +.dashboard { + margin: 16px; +} diff --git a/app/react-components/devtools/tiles.jsx b/app/react-components/devtools/tiles.jsx index 3cfaa7d..920368e 100644 --- a/app/react-components/devtools/tiles.jsx +++ b/app/react-components/devtools/tiles.jsx @@ -35,7 +35,7 @@ export default function Tiles({ - Layer: + Layer { setLayer(event.target.value) @@ -58,7 +58,7 @@ export default function Tiles({ - Brush: + Brush { setBrush(event.target.value) @@ -76,14 +76,18 @@ export default function Tiles({ onMouseDown={(event) => { const wrapperRect = wrapperRef.current.getBoundingClientRect(); const {left, top} = wrapperRect; + const c = { + x: event.clientX, + y: event.clientY + wrapperRef.current.scrollTop, + }; if ( - event.clientX - left >= (w * factor) - || event.clientY - top >= (h * factor) + c.x - left >= (w * factor) + || c.y - top >= (h * factor) ) { return; } - const x = Math.floor((event.clientX - left) / (tileSize.x * factor)); - const y = Math.floor((event.clientY - top) / (tileSize.y * factor)); + const x = Math.floor((c.x - left) / (tileSize.x * factor)); + const y = Math.floor((c.y - top) / (tileSize.y * factor)); setMoveStart({x, y}); setSelection({x, y, w: 1, h: 1}); }} @@ -94,11 +98,15 @@ export default function Tiles({ const {x: sx, y: sy} = moveStart; const wrapperRect = wrapperRef.current.getBoundingClientRect(); const {left, top} = wrapperRect; + const c = { + x: event.clientX, + y: event.clientY + wrapperRef.current.scrollTop, + }; const x = Math.floor( - Math.max(0, Math.min((w * factor) - 1, (event.clientX - left)) / (tileSize.x * factor)), + Math.max(0, Math.min((w * factor) - 1, (c.x - left)) / (tileSize.x * factor)), ); const y = Math.floor( - Math.max(0, Math.min((h * factor) - 1, (event.clientY - top)) / (tileSize.y * factor)), + Math.max(0, Math.min((h * factor) - 1, (c.y - top)) / (tileSize.y * factor)), ); const mx = Math.min(sx, x); const my = Math.min(sy, y); diff --git a/app/react-components/devtools/tiles.module.css b/app/react-components/devtools/tiles.module.css index 5ed1869..8d62aa2 100644 --- a/app/react-components/devtools/tiles.module.css +++ b/app/react-components/devtools/tiles.module.css @@ -1,10 +1,21 @@ +.tiles { + display: flex; + height: 100%; + flex-direction: column; +} + .paintBar { display: flex; gap: 16px; - margin: 16px 0; + margin: 16px; + margin-bottom: 0; } .selectionWrapper { + margin: 16px; + margin-right: 0; + overflow-y: auto; + padding-right: 16px; position: relative; }