ng2-canvas-whiteboard
ng2-canvas-whiteboard copied to clipboard
the drawn lines move a bit (+/-2px) when mouse click is released, is it intended ?
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 :
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 :