Fix PiP positioning
This commit is contained in:
parent
8b87fe23e2
commit
7c4344f43a
1 changed files with 7 additions and 7 deletions
|
@ -105,8 +105,8 @@ export const CallingPip = ({
|
||||||
if (positionState.mode === PositionMode.BeingDragged) {
|
if (positionState.mode === PositionMode.BeingDragged) {
|
||||||
setPositionState(oldState => ({
|
setPositionState(oldState => ({
|
||||||
...oldState,
|
...oldState,
|
||||||
mouseX: ev.screenX,
|
mouseX: ev.clientX,
|
||||||
mouseY: ev.screenY,
|
mouseY: ev.clientY,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -252,13 +252,13 @@ export const CallingPip = ({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const rect = node.getBoundingClientRect();
|
const rect = node.getBoundingClientRect();
|
||||||
const dragOffsetX = ev.screenX - rect.left;
|
const dragOffsetX = ev.clientX - rect.left;
|
||||||
const dragOffsetY = ev.screenY - rect.top;
|
const dragOffsetY = ev.clientY - rect.top;
|
||||||
|
|
||||||
setPositionState({
|
setPositionState({
|
||||||
mode: PositionMode.BeingDragged,
|
mode: PositionMode.BeingDragged,
|
||||||
mouseX: ev.screenX,
|
mouseX: ev.clientX,
|
||||||
mouseY: ev.screenY,
|
mouseY: ev.clientY,
|
||||||
dragOffsetX,
|
dragOffsetX,
|
||||||
dragOffsetY,
|
dragOffsetY,
|
||||||
});
|
});
|
||||||
|
@ -269,7 +269,7 @@ export const CallingPip = ({
|
||||||
positionState.mode === PositionMode.BeingDragged
|
positionState.mode === PositionMode.BeingDragged
|
||||||
? '-webkit-grabbing'
|
? '-webkit-grabbing'
|
||||||
: '-webkit-grab',
|
: '-webkit-grab',
|
||||||
transform: `translate3d(${translateX}px,${translateY}px, 0)`,
|
transform: `translate3d(${translateX}px,calc(${translateY}px - var(--titlebar-height)), 0)`,
|
||||||
transition:
|
transition:
|
||||||
positionState.mode === PositionMode.BeingDragged
|
positionState.mode === PositionMode.BeingDragged
|
||||||
? 'none'
|
? 'none'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue