Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

the drawn lines move a bit (+/-2px) when mouse click is released, is it intended ? #59

Open
borisBelloc opened this issue Mar 28, 2020 · 0 comments

Comments

@borisBelloc
Copy link

hello,

When I draw something on my canvas, the drawn thing move +/-2 pixel to the bottom when I release the click, is it normal or did I do something wrong with my setting?

here is a gif :
img1

It could be a problem if anyone need to draw something precise, is there is a solution to fix it ?

my config: Angular 9, used npm to install ng2-canvas-whiteboard

Code :
My canvas is really basic.

Parent component :

           <canvas-whiteboard
               #canvasWhiteboardSignature
               [options]="canvasOptions"
               >
           </canvas-whiteboard>

The options :

  canvasOptions: CanvasWhiteboardOptions = {
     drawingEnabled: true,
     lineWidth: 2.5,
    strokeColor: 'rgb(0,0,0)',
    drawButtonEnabled: false,
    drawButtonClass: 'drawButtonClass',
    drawButtonText: 'Draw',
    clearButtonEnabled: false,
    clearButtonClass: 'clearButtonClass',
    clearButtonText: 'Clear',
    undoButtonText: 'Undo',
    undoButtonEnabled: false,
    redoButtonText: 'Redo',
    redoButtonEnabled: false,
    colorPickerEnabled: false,
    saveDataButtonEnabled: false,
    saveDataButtonText: 'Save',
    shapeSelectorEnabled: false,
    shouldDownloadDrawing: false
  };

The canvas's container CSS contain only a height :

#canvaContainer {
  height: 150px;
}

Not sure if that CSS is the good practice to give a size to the canvas, without it, the canvas was just a lane :
img2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant