mirror of
https://github.com/trafficlunar/blockmatic.git
synced 2026-06-28 14:44:12 +00:00
fix: height issues in open image dialog
This commit is contained in:
parent
25f519074a
commit
cf83d2fc7c
2 changed files with 5 additions and 7 deletions
|
|
@ -24,7 +24,7 @@ function BlockSelector({ stageWidth, searchInput, selectedBlocks, setSelectedBlo
|
|||
const [hoverPosition, setHoverPosition] = useState<Position | null>(null);
|
||||
|
||||
const filteredBlocks = useMemo(() => Object.keys(blockData).filter((value) => value.includes(searchInput)), [searchInput, blockData]);
|
||||
const blocksPerColumn = Math.floor(462 / (32 + 2));
|
||||
const blocksPerColumn = Math.floor(stageWidth / (32 + 2));
|
||||
|
||||
const onClick = (block: string) => {
|
||||
if (selectedBlocks.includes(block)) {
|
||||
|
|
@ -36,7 +36,7 @@ function BlockSelector({ stageWidth, searchInput, selectedBlocks, setSelectedBlo
|
|||
|
||||
return (
|
||||
<Stage
|
||||
width={462}
|
||||
width={stageWidth}
|
||||
height={Math.ceil(Object.keys(blockData).length / blocksPerColumn) * (32 + 2)}
|
||||
options={{ backgroundAlpha: 0 }}
|
||||
onMouseLeave={() => setHoverPosition(null)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue