Fix svg viewer position
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Siklos 2022-08-08 11:31:33 +02:00
parent a42ac77d33
commit 6fe4025a58
2 changed files with 9 additions and 6 deletions

View file

@ -3,6 +3,7 @@ import { UncontrolledReactSVGPanZoom } from 'react-svg-pan-zoom';
import { Container } from './Elements/Container';
import { ContainerModel } from '../../Interfaces/ContainerModel';
import { Selector } from './Elements/Selector';
import { BAR_WIDTH } from '../Bar/Bar';
interface ISVGProps {
width: number
@ -12,8 +13,8 @@ interface ISVGProps {
}
interface ISVGState {
viewerWidth: number,
viewerHeight: number,
viewerWidth: number
viewerHeight: number
}
export class SVG extends React.PureComponent<ISVGProps> {
@ -23,14 +24,14 @@ export class SVG extends React.PureComponent<ISVGProps> {
constructor(props: ISVGProps) {
super(props);
this.state = {
viewerWidth: window.innerWidth,
viewerWidth: window.innerWidth - BAR_WIDTH,
viewerHeight: window.innerHeight
};
}
resizeViewBox(): void {
this.setState({
viewerWidth: window.innerWidth,
viewerWidth: window.innerWidth - BAR_WIDTH,
viewerHeight: window.innerHeight
});
}
@ -60,7 +61,7 @@ export class SVG extends React.PureComponent<ISVGProps> {
}
return (
<div id={SVG.ID}>
<div id={SVG.ID} className='ml-16'>
<UncontrolledReactSVGPanZoom
width={this.state.viewerWidth}
height={this.state.viewerHeight}
@ -69,7 +70,7 @@ export class SVG extends React.PureComponent<ISVGProps> {
miniatureProps={{
position: 'left',
background: '#616264',
width: window.innerWidth - 12,
width: window.innerWidth - 12 - BAR_WIDTH,
height: 120
}}
>