Commit 66fa8463 authored by Chunchi Che's avatar Chunchi Che

fix hover scale

parent 9fd16189
Pipeline #18894 passed with stages
in 2 minutes and 35 seconds
...@@ -29,6 +29,7 @@ const DuelHands = () => { ...@@ -29,6 +29,7 @@ const DuelHands = () => {
const DuelHand = (props: { state: Card; idx: number }) => { const DuelHand = (props: { state: Card; idx: number }) => {
const handShape = CONFIG.HandShape(); const handShape = CONFIG.HandShape();
const hoverScale = CONFIG.HandHoverScaling(); const hoverScale = CONFIG.HandHoverScaling();
const defaultScale = new BABYLON.Vector3(1, 1, 1);
const planeRef = useRef(null); const planeRef = useRef(null);
const [state, idx] = [props.state, props.idx]; const [state, idx] = [props.state, props.idx];
const [hovered, setHovered] = useState(false); const [hovered, setHovered] = useState(false);
...@@ -68,8 +69,9 @@ const DuelHand = (props: { state: Card; idx: number }) => { ...@@ -68,8 +69,9 @@ const DuelHand = (props: { state: Card; idx: number }) => {
<plane <plane
name={`hand-${idx}`} name={`hand-${idx}`}
ref={planeRef} ref={planeRef}
width={hovered ? handShape.width * hoverScale.x : handShape.width} width={handShape.width}
height={hovered ? handShape.height * hoverScale.z : handShape.height} height={handShape.height}
scaling={hovered ? hoverScale : defaultScale}
position={ position={
new BABYLON.Vector3( new BABYLON.Vector3(
state.transform.position?.x, state.transform.position?.x,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment