fix code style for pip
This commit is contained in:
parent
d5081abaf4
commit
44158e8c98
1 changed files with 12 additions and 2 deletions
|
@ -130,14 +130,24 @@ export function CallingPip({
|
|||
const offsetX = mouseX - dragOffsetX;
|
||||
const offsetY = mouseY - dragOffsetY;
|
||||
|
||||
let distanceToLeftEdge: number;
|
||||
let distanceToRightEdge: number;
|
||||
if (isRTL) {
|
||||
distanceToLeftEdge = innerWidth - (offsetX + PIP_WIDTH);
|
||||
distanceToRightEdge = offsetX;
|
||||
} else {
|
||||
distanceToLeftEdge = offsetX;
|
||||
distanceToRightEdge = innerWidth - (offsetX + PIP_WIDTH);
|
||||
}
|
||||
|
||||
const snapCandidates: Array<SnapCandidate> = [
|
||||
{
|
||||
mode: PositionMode.SnapToLeft,
|
||||
distanceToEdge: isRTL ? innerWidth - (offsetX + PIP_WIDTH) : offsetX,
|
||||
distanceToEdge: distanceToLeftEdge,
|
||||
},
|
||||
{
|
||||
mode: PositionMode.SnapToRight,
|
||||
distanceToEdge: isRTL ? offsetX : innerWidth - (offsetX + PIP_WIDTH),
|
||||
distanceToEdge: distanceToRightEdge,
|
||||
},
|
||||
{
|
||||
mode: PositionMode.SnapToTop,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue