You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
532 B
TypeScript
33 lines
532 B
TypeScript
import React from 'react';
|
|
|
|
import {
|
|
Icon,
|
|
Tooltip,
|
|
} from 'antd';
|
|
|
|
import {
|
|
FitIcon,
|
|
} from 'icons';
|
|
|
|
import {
|
|
Canvas,
|
|
} from 'cvat-canvas';
|
|
|
|
interface Props {
|
|
canvasInstance: Canvas;
|
|
}
|
|
|
|
function FitControl(props: Props): JSX.Element {
|
|
const {
|
|
canvasInstance,
|
|
} = props;
|
|
|
|
return (
|
|
<Tooltip title='Fit the image' placement='right'>
|
|
<Icon component={FitIcon} onClick={(): void => canvasInstance.fit()} />
|
|
</Tooltip>
|
|
);
|
|
}
|
|
|
|
export default React.memo(FitControl);
|