fix: change alpha in block selector(s) when selected
This commit is contained in:
parent
dc0ac2cc82
commit
b58d778087
2 changed files with 2 additions and 3 deletions
|
|
@ -70,7 +70,7 @@ function BlockSelector({ stageWidth, searchInput, selectedBlocks, setSelectedBlo
|
||||||
eventMode={"static"}
|
eventMode={"static"}
|
||||||
pointerover={() => setHoverPosition({ x, y })}
|
pointerover={() => setHoverPosition({ x, y })}
|
||||||
click={() => onClick(block)}
|
click={() => onClick(block)}
|
||||||
alpha={0.2}
|
alpha={selectedBlocks.includes(block) ? 1 : 0.2}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{selectedBlocks.includes(block) && (
|
{selectedBlocks.includes(block) && (
|
||||||
|
|
@ -80,7 +80,6 @@ function BlockSelector({ stageWidth, searchInput, selectedBlocks, setSelectedBlo
|
||||||
y={y}
|
y={y}
|
||||||
draw={(g) => {
|
draw={(g) => {
|
||||||
g.clear();
|
g.clear();
|
||||||
g.beginFill(0xffffff, 0.2);
|
|
||||||
g.lineStyle(2, isDark ? 0xffffff : 0x000000, 0.4, 0);
|
g.lineStyle(2, isDark ? 0xffffff : 0x000000, 0.4, 0);
|
||||||
g.drawRect(0, 0, 32, 32);
|
g.drawRect(0, 0, 32, 32);
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ function BlockSelector({ stageWidth, searchInput }: Props) {
|
||||||
mouseover={() => setHoverPosition({ x, y })}
|
mouseover={() => setHoverPosition({ x, y })}
|
||||||
click={onClick}
|
click={onClick}
|
||||||
tap={onClick}
|
tap={onClick}
|
||||||
alpha={0.3}
|
alpha={selectedBlock == block ? 1 : 0.3}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue