Skip to content
Snippets Groups Projects
Commit 45929433 authored by Samuel Jugnet's avatar Samuel Jugnet
Browse files

mitigation transformer a la sauvegarde

parent 37674e6b
Branches
No related tags found
No related merge requests found
......@@ -101,6 +101,8 @@ function AnnotationCreation(props) {
const [shapes, setShapes] = useState([]);
const [scale, setScale] = useState(1);
const [isMouseOverSave, setIsMouseOverSave] = useState(false);
const { height, width } = VideosReferences.get(props.windowId).ref.current;
......@@ -484,6 +486,7 @@ function AnnotationCreation(props) {
setColorToolFromCurrentShape={setColorToolFromCurrentShape}
updateShapes={updateShapes}
shapes={shapes}
isMouseOverSave={isMouseOverSave}
/>
<StyledForm
onSubmit={submitForm}
......@@ -527,7 +530,10 @@ function AnnotationCreation(props) {
<Button onClick={closeCompanionWindow}>
Cancel
</Button>
<Button variant="contained" color="primary" type="submit">
<Button variant="contained" color="primary" type="submit"
onMouseOver={() => setIsMouseOverSave(true)}
onMouseOut={() => setIsMouseOverSave(false)}
>
Save
</Button>
......
......@@ -497,6 +497,7 @@ function AnnotationDrawing(props) {
height={props.originalHeight}
onTransform={onTransform}
handleDragEnd={handleDragEnd}
isMouseOverSave={props.isMouseOverSave}
/>
</Stage>
);
......
......@@ -16,6 +16,7 @@ import ImageShape from './Image';
function ParentComponent({
shapes, onShapeClick, selectedShapeId, activeTool,
scale, width, height, onTransform, handleDragEnd,
isMouseOverSave
}) {
// TODO Simplify these state
const [selectedShape, setSelectedShape] = useState(null);
......@@ -47,7 +48,7 @@ function ParentComponent({
scaleY={scale}
>
{shapes.map((shape, i) => {
const isSelected = selectedShapeId === shape.id;
const isSelected = selectedShapeId === shape.id && isMouseOverSave===false;
switch (shape.type) {
case 'rectangle':
return (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment