Skip to content
Snippets Groups Projects
Commit f50f2a18 authored by Antoine Roy's avatar Antoine Roy
Browse files

cleaner code

parent c6379c21
No related branches found
No related tags found
2 merge requests!28Resolve "Sauvegarder une annotation",!10Draft: MigratingAnnotationCreation to MUI5.
Pipeline #1892 failed
...@@ -269,9 +269,7 @@ function AnnotationCreation(props) { ...@@ -269,9 +269,7 @@ function AnnotationCreation(props) {
* This image will be put in overlay of the iiif media * This image will be put in overlay of the iiif media
*/ */
const getSvg = async () => { const getSvg = async () => {
console.log('ENTER GET SVG')
const stage = window.Konva.stages.find((s) => s.attrs.id === props.windowId); const stage = window.Konva.stages.find((s) => s.attrs.id === props.windowId);
console.log('stage', stage);
const svg = await exportStageSVG(stage, false); // TODO clean const svg = await exportStageSVG(stage, false); // TODO clean
return svg; return svg;
}; };
...@@ -355,9 +353,7 @@ function AnnotationCreation(props) { ...@@ -355,9 +353,7 @@ function AnnotationCreation(props) {
konvaThing, konvaThing,
} = state; } = state;
// TODO rename variable for better comprenhension // TODO rename variable for better comprenhension
console.log('BEFORE GET SVG')
const svg = await getSvg(); const svg = await getSvg();
console.log('SVG',svg)
const t = (tstart && tend) ? `${tstart},${tend}` : null; const t = (tstart && tend) ? `${tstart},${tend}` : null;
const body = { value: (!textBody.length && t) ? `${secondsToHMS(tstart)} -> ${secondsToHMS(tend)}` : textBody }; const body = { value: (!textBody.length && t) ? `${secondsToHMS(tstart)} -> ${secondsToHMS(tend)}` : textBody };
// TODO promises not handled. Use promiseAll ? // TODO promises not handled. Use promiseAll ?
......
...@@ -410,7 +410,7 @@ function AnnotationDrawing(props) { ...@@ -410,7 +410,7 @@ function AnnotationDrawing(props) {
} }
} catch (error) { } catch (error) {
console.log('error', error); console.log('error', error);
}'rgba(255, 0, 0, 0.5)' }
}; };
/** Stop drawing */ /** Stop drawing */
......
...@@ -131,8 +131,6 @@ function AnnotationFormOverlayToolOptions({ updateToolState, toolState }) { ...@@ -131,8 +131,6 @@ function AnnotationFormOverlayToolOptions({ updateToolState, toolState }) {
/** Update color : fillColor or strokeColor */ /** Update color : fillColor or strokeColor */
const updateColor = (color) => { const updateColor = (color) => {
console.log('color', color);
console.log('color.rgb',color.rgb)
updateToolState({ updateToolState({
...toolState, ...toolState,
[toolOptions.currentColorType]: objToRgba(color.rgb), [toolOptions.currentColorType]: objToRgba(color.rgb),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment