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

wip scale canvas

parent e8b30dd5
No related branches found
No related tags found
1 merge request!10Draft: MigratingAnnotationCreation to MUI5.
Pipeline #1779 failed
......@@ -513,7 +513,7 @@ function AnnotationCreation(props) {
}
console.log('overlay',overlay);
const scale = overlay.containerWidth / overlay.canvasWidth;
......@@ -542,7 +542,7 @@ function AnnotationCreation(props) {
left: 0,
width: '100%',
height: 'auto',
border: '1px solid orange',
}}
scale={scale}
activeTool={activeTool}
......
......@@ -183,6 +183,8 @@ function AnnotationDrawing(props) {
const pos = e.target.getStage().getRelativePointerPosition();
pos.x = pos.x/props.scale;
pos.y = pos.y/props.scale;
// const relativePos = e.target.getStage().getRelativePointerPosition();
// debug('mouse down debut');
let shape = null;
......@@ -350,6 +352,8 @@ function AnnotationDrawing(props) {
return;
}
const pos = e.target.getStage().getRelativePointerPosition();
pos.x = pos.x/props.scale;
pos.y = pos.y/props.scale;
switch (props.activeTool) {
......@@ -440,6 +444,8 @@ function AnnotationDrawing(props) {
const pos = e.target.getStage().getRelativePointerPosition();
pos.x = pos.x/props.scale;
pos.y = pos.y/props.scale;
try {
// if (!isDrawing) return;
if (!currentShape) return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment