mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Introduce ellipse tool (which draws rectangle for now)
This commit is contained in:
@@ -35,12 +35,12 @@ on('click',"eraser-smaller-button", function(e){
|
||||
on('click','rectangle-button', function(e){
|
||||
// If the user clicks twice on the button, they change the draw mode
|
||||
if (currentTool.name == 'rectangle') {
|
||||
if (drawMode == 'empty') {
|
||||
drawMode = 'fill';
|
||||
if (rectangleDrawMode == 'empty') {
|
||||
rectangleDrawMode = 'fill';
|
||||
setRectToolSvg();
|
||||
}
|
||||
else {
|
||||
drawMode = 'empty';
|
||||
rectangleDrawMode = 'empty';
|
||||
setRectToolSvg();
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,24 @@ on('click','rectangle-button', function(e){
|
||||
}
|
||||
}, false);
|
||||
|
||||
// ellipse
|
||||
on('click','ellipse-button', function(e){
|
||||
// If the user clicks twice on the button, they change the draw mode
|
||||
if (currentTool.name == 'ellipse') {
|
||||
if (ellipseDrawMode == 'empty') {
|
||||
ellipseDrawMode = 'fill';
|
||||
setEllipseToolSvg();
|
||||
}
|
||||
else {
|
||||
ellipseDrawMode = 'empty';
|
||||
setEllipseToolSvg();
|
||||
}
|
||||
}
|
||||
else {
|
||||
tool.ellipse.switchTo();
|
||||
}
|
||||
}, false);
|
||||
|
||||
// rectangle bigger
|
||||
on('click',"rectangle-bigger-button", function(){
|
||||
tool.rectangle.brushSize++;
|
||||
@@ -60,6 +78,17 @@ on('click',"rectangle-smaller-button", function(e){
|
||||
tool.rectangle.brushSize--;
|
||||
}, false);
|
||||
|
||||
// ellipse bigger
|
||||
on('click',"ellipse-bigger-button", function(){
|
||||
tool.ellipse.brushSize++;
|
||||
}, false);
|
||||
|
||||
// ellipse smaller
|
||||
on('click',"ellipse-smaller-button", function(e){
|
||||
if(tool.ellipse.brushSize > 1)
|
||||
tool.ellipse.brushSize--;
|
||||
}, false);
|
||||
|
||||
//fill
|
||||
on('click',"fill-button", function(){
|
||||
tool.fill.switchTo();
|
||||
|
||||
Reference in New Issue
Block a user