You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
@@ -27,6 +27,7 @@ import SettingsStore from "../../../settings/SettingsStore";
|
|||||||
import { CallEvent, CallState, MatrixCall } from 'matrix-js-sdk/src/webrtc/call';
|
import { CallEvent, CallState, MatrixCall } from 'matrix-js-sdk/src/webrtc/call';
|
||||||
import { MatrixClientPeg } from '../../../MatrixClientPeg';
|
import { MatrixClientPeg } from '../../../MatrixClientPeg';
|
||||||
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
||||||
|
import UIStore from '../../../stores/UIStore';
|
||||||
|
|
||||||
const PIP_VIEW_WIDTH = 336;
|
const PIP_VIEW_WIDTH = 336;
|
||||||
const PIP_VIEW_HEIGHT = 232;
|
const PIP_VIEW_HEIGHT = 232;
|
||||||
@@ -118,7 +119,7 @@ export default class CallPreview extends React.Component<IProps, IState> {
|
|||||||
roomId,
|
roomId,
|
||||||
primaryCall: primaryCall,
|
primaryCall: primaryCall,
|
||||||
secondaryCall: secondaryCalls[0],
|
secondaryCall: secondaryCalls[0],
|
||||||
translationX: window.innerWidth - DEFAULT_X_OFFSET - PIP_VIEW_WIDTH,
|
translationX: UIStore.instance.windowWidth - DEFAULT_X_OFFSET - PIP_VIEW_WIDTH,
|
||||||
translationY: DEFAULT_Y_OFFSET,
|
translationY: DEFAULT_Y_OFFSET,
|
||||||
moving: false,
|
moving: false,
|
||||||
};
|
};
|
||||||
@@ -164,8 +165,8 @@ export default class CallPreview extends React.Component<IProps, IState> {
|
|||||||
let outTranslationY;
|
let outTranslationY;
|
||||||
|
|
||||||
// Avoid overflow on the x axis
|
// Avoid overflow on the x axis
|
||||||
if (inTranslationX + width >= window.innerWidth) {
|
if (inTranslationX + width >= UIStore.instance.windowWidth) {
|
||||||
outTranslationX = window.innerWidth - width;
|
outTranslationX = UIStore.instance.windowWidth - width;
|
||||||
} else if (inTranslationX <= 0) {
|
} else if (inTranslationX <= 0) {
|
||||||
outTranslationX = 0;
|
outTranslationX = 0;
|
||||||
} else {
|
} else {
|
||||||
@@ -173,8 +174,8 @@ export default class CallPreview extends React.Component<IProps, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Avoid overflow on the y axis
|
// Avoid overflow on the y axis
|
||||||
if (inTranslationY + height >= window.innerHeight) {
|
if (inTranslationY + height >= UIStore.instance.windowHeight) {
|
||||||
outTranslationY = window.innerHeight - height;
|
outTranslationY = UIStore.instance.windowHeight - height;
|
||||||
} else if (inTranslationY <= 0) {
|
} else if (inTranslationY <= 0) {
|
||||||
outTranslationY = 0;
|
outTranslationY = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user