Take panel height into account
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
parent
d421c3203f
commit
7c81526805
|
@ -45,6 +45,8 @@ const ZOOM_COEFFICIENT = 0.0025;
|
||||||
// If we have moved only this much we can zoom
|
// If we have moved only this much we can zoom
|
||||||
const ZOOM_DISTANCE = 10;
|
const ZOOM_DISTANCE = 10;
|
||||||
|
|
||||||
|
const PANEL_HEIGHT = 68;
|
||||||
|
|
||||||
interface IProps extends IDialogProps {
|
interface IProps extends IDialogProps {
|
||||||
src: string; // the source of the image being displayed
|
src: string; // the source of the image being displayed
|
||||||
name?: string; // the main title ('name') for the image
|
name?: string; // the main title ('name') for the image
|
||||||
|
@ -91,8 +93,17 @@ export default class ImageView extends React.Component<IProps, IState> {
|
||||||
minZoom: MAX_SCALE,
|
minZoom: MAX_SCALE,
|
||||||
maxZoom: MAX_SCALE,
|
maxZoom: MAX_SCALE,
|
||||||
rotation: 0,
|
rotation: 0,
|
||||||
translationX: thumbnailInfo?.positionX + (thumbnailInfo?.width / 2) - (UIStore.instance.windowWidth / 2),
|
translationX: (
|
||||||
translationY: thumbnailInfo?.positionY + (thumbnailInfo?.height / 2) - (UIStore.instance.windowHeight / 2),
|
thumbnailInfo?.positionX +
|
||||||
|
(thumbnailInfo?.width / 2) -
|
||||||
|
(UIStore.instance.windowWidth / 2)
|
||||||
|
),
|
||||||
|
translationY: (
|
||||||
|
thumbnailInfo?.positionY +
|
||||||
|
(thumbnailInfo?.height / 2) -
|
||||||
|
(UIStore.instance.windowHeight / 2) -
|
||||||
|
(PANEL_HEIGHT / 2)
|
||||||
|
),
|
||||||
moving: false,
|
moving: false,
|
||||||
contextMenuDisplayed: false,
|
contextMenuDisplayed: false,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue