Change token fade hover to only be on drawing
This commit is contained in:
parent
6aef95c78c
commit
e1733bb504
@ -241,6 +241,7 @@ function Map({
|
||||
selectedToolId === "pan" && !(tokenState.id in disabledTokens)
|
||||
}
|
||||
mapState={mapState}
|
||||
fadeOnHover={selectedToolId === "drawing"}
|
||||
/>
|
||||
))}
|
||||
</Group>
|
||||
|
@ -25,6 +25,7 @@ function MapToken({
|
||||
onTokenDragEnd,
|
||||
draggable,
|
||||
mapState,
|
||||
fadeOnHover,
|
||||
}) {
|
||||
const { userId } = useContext(AuthContext);
|
||||
const {
|
||||
@ -127,13 +128,13 @@ function MapToken({
|
||||
}
|
||||
}
|
||||
|
||||
function handlePointerOver() {
|
||||
if (!draggable) {
|
||||
function handlePointerEnter() {
|
||||
if (fadeOnHover) {
|
||||
setTokenOpacity(0.5);
|
||||
}
|
||||
}
|
||||
|
||||
function handlePointerOut() {
|
||||
function handlePointerLeave() {
|
||||
if (tokenOpacity !== 1.0) {
|
||||
setTokenOpacity(1.0);
|
||||
}
|
||||
@ -183,8 +184,8 @@ function MapToken({
|
||||
draggable={draggable}
|
||||
onMouseDown={handlePointerDown}
|
||||
onMouseUp={handlePointerUp}
|
||||
onMouseOver={handlePointerOver}
|
||||
onMouseOut={handlePointerOut}
|
||||
onMouseEnter={handlePointerEnter}
|
||||
onMouseLeave={handlePointerLeave}
|
||||
onTouchStart={handlePointerDown}
|
||||
onTouchEnd={handlePointerUp}
|
||||
onClick={handleClick}
|
||||
|
Loading…
Reference in New Issue
Block a user