mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Almost finished recangle tool
There's a Math.round bug, sometimes the opacity is off.
This commit is contained in:
@ -3,13 +3,10 @@ let startX;
|
||||
let startY;
|
||||
let endX;
|
||||
let endY;
|
||||
let workingLayer;
|
||||
|
||||
function startRectSelection(mouseEvent) {
|
||||
// Putting the vfx layer on top of everything
|
||||
VFXCanvas.style.zIndex = MAX_Z_INDEX;
|
||||
// Saving the layer the user is working on
|
||||
workingLayer = currentLayer;
|
||||
|
||||
// Saving the start coords of the rect
|
||||
let cursorPos = getCursorPosition(mouseEvent);
|
||||
@ -92,6 +89,7 @@ function drawRect(x, y) {
|
||||
// Clearing the vfx canvas
|
||||
vfxContext.clearRect(0, 0, VFXCanvas.width, VFXCanvas.height);
|
||||
vfxContext.lineWidth = 1;
|
||||
vfxContext.fillStyle = "black";
|
||||
vfxContext.setLineDash([4]);
|
||||
|
||||
// Drawing the rect
|
||||
|
Reference in New Issue
Block a user