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:
@ -32,6 +32,34 @@ on('click',"eraser-smaller-button", function(e){
|
||||
updateCursor();
|
||||
}, false);
|
||||
|
||||
// rectangle
|
||||
on('click',"rectangle-button", function(){
|
||||
// If the user clicks twice on the button, they change the draw mode
|
||||
if (currentTool == 'rectangle') {
|
||||
if (drawMode == 'empty') {
|
||||
drawMode = 'full';
|
||||
}
|
||||
else {
|
||||
drawMode = 'empty';
|
||||
}
|
||||
}
|
||||
else {
|
||||
changeTool('rectangle');
|
||||
}
|
||||
}, false);
|
||||
|
||||
// rectangle bigger
|
||||
on('click',"rectangle-bigger-button", function(){
|
||||
rectangleSize++;
|
||||
updateCursor();
|
||||
}, false);
|
||||
|
||||
// rectangle smaller
|
||||
on('click',"rectangle-smaller-button", function(e){
|
||||
if(rectangleSize > 1) rectangleSize--;
|
||||
updateCursor();
|
||||
}, false);
|
||||
|
||||
//fill
|
||||
on('click',"fill-button", function(){
|
||||
changeTool('fill');
|
||||
|
Reference in New Issue
Block a user