Added new shortcuts
This commit is contained in:
parent
a8c1851ace
commit
093c320eab
27
BUILD.md
27
BUILD.md
@ -27,11 +27,12 @@ cd /xxiivv/Nataniev/public/public.projects/builds/
|
||||
~/butler push /xxiivv/Nataniev/public/public.projects/builds/Dotgrid-win32-x64/ hundredrabbits/dotgrid:windows-64
|
||||
~/butler push /xxiivv/Nataniev/public/public.projects/builds/Dotgrid-darwin-x64/ hundredrabbits/dotgrid:osx-64
|
||||
|
||||
~/butler status hundredrabbits/dotgrid
|
||||
|
||||
rm -r /xxiivv/Nataniev/public/public.projects/builds/Dotgrid-darwin-x64/
|
||||
rm -r /xxiivv/Nataniev/public/public.projects/builds/Dotgrid-linux-x64/
|
||||
rm -r /xxiivv/Nataniev/public/public.projects/builds/Dotgrid-win32-x64/
|
||||
|
||||
~/butler status hundredrabbits/dotgrid
|
||||
|
||||
```
|
||||
|
||||
@ -52,3 +53,27 @@ electron-packager . Dotgrid --platform=linux --arch=x64 --out /Users/VillaMoirai
|
||||
cd /Users/VillaMoirai/Github/HundredRabbits/Dotgrid/
|
||||
electron-packager . Dotgrid --platform=win32 --arch=x64 --out /Users/VillaMoirai/Desktop/ --overwrite --electron-version=1.7.5 --icon=icon.ico
|
||||
```
|
||||
|
||||
### Build
|
||||
```
|
||||
cd /Users/VillaMoirai/Desktop/
|
||||
rm -r /Users/VillaMoirai/Desktop/Dotgrid-darwin-x64/
|
||||
rm -r /Users/VillaMoirai/Desktop/Ronin-darwin-x64/
|
||||
rm -r /Users/VillaMoirai/Desktop/Left-darwin-x64/
|
||||
rm -r /Users/VillaMoirai/Desktop/Marabu-darwin-x64/
|
||||
|
||||
cd /Users/VillaMoirai/Github/HundredRabbits/Dotgrid/
|
||||
electron-packager . Dotgrid --platform=darwin --arch=x64 --out /Users/VillaMoirai/Desktop/ --overwrite --electron-version=1.7.5 --icon=icon.icns
|
||||
|
||||
cd /Users/VillaMoirai/Github/HundredRabbits/Ronin/
|
||||
electron-packager . Ronin --platform=darwin --arch=x64 --out /Users/VillaMoirai/Desktop/ --overwrite --electron-version=1.7.5 --icon=icon.icns
|
||||
|
||||
cd /Users/VillaMoirai/Github/HundredRabbits/Left/
|
||||
electron-packager . Left --platform=darwin --arch=x64 --out /Users/VillaMoirai/Desktop/ --overwrite --electron-version=1.7.5 --icon=icon.icns
|
||||
|
||||
cd /Users/VillaMoirai/Github/HundredRabbits/Marabu/
|
||||
electron-packager . Marabu --platform=darwin --arch=x64 --out /Users/VillaMoirai/Desktop/ --overwrite --electron-version=1.7.5 --icon=icon.icns
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
@ -30,6 +30,11 @@ It works by adding control points and selecting a stroke type. So clicking the c
|
||||
- `-` Reduce stroke size.
|
||||
- `/` Toggle linecap.
|
||||
|
||||
### Shortcuts
|
||||
|
||||
- `ctrl+n` New canvas.
|
||||
- `alt+click` Erase target stroke.
|
||||
|
||||
## License
|
||||
|
||||
See the [LICENSE](LICENSE.md) file for license rights and limitations (CC).
|
||||
|
@ -136,6 +136,7 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca
|
||||
var pos = this.position_in_grid(new Pos(e.clientX,e.clientY));
|
||||
pos = this.position_on_grid(pos);
|
||||
|
||||
if(e.altKey){ dotgrid.delete_at(pos); return; }
|
||||
if(pos.x>0) return;
|
||||
|
||||
if(from === null){ this.set_from(pos); }
|
||||
@ -170,6 +171,21 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca
|
||||
end = pos;
|
||||
}
|
||||
|
||||
this.delete_at = function(pos)
|
||||
{
|
||||
var segs = [];
|
||||
|
||||
for(id in this.segments){
|
||||
var s = this.segments[id];
|
||||
if(s.from && s.from.is_equal(pos)){ continue; }
|
||||
if(s.to && s.to.is_equal(pos)){ continue; }
|
||||
if(s.end && s.end.is_equal(pos)){ continue; }
|
||||
segs.push(s);
|
||||
}
|
||||
this.segments = segs;
|
||||
this.draw();
|
||||
}
|
||||
|
||||
this.mod_thickness = function(mod)
|
||||
{
|
||||
this.thickness = Math.max(this.thickness+mod,0);
|
||||
@ -253,7 +269,7 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca
|
||||
this.segments.push(new Path_Line(from,to,end));
|
||||
|
||||
this.draw();
|
||||
reset();
|
||||
this.reset();
|
||||
}
|
||||
|
||||
this.draw_arc = function(orientation)
|
||||
@ -267,7 +283,7 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca
|
||||
this.segments.push(new Path_Arc(from,to,orientation,end));
|
||||
|
||||
this.draw();
|
||||
reset();
|
||||
this.reset();
|
||||
}
|
||||
|
||||
this.draw_bezier = function()
|
||||
@ -281,7 +297,7 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca
|
||||
this.segments.push(new Path_Bezier(from,to,end));
|
||||
|
||||
this.draw();
|
||||
reset();
|
||||
this.reset();
|
||||
}
|
||||
|
||||
this.draw_close = function()
|
||||
@ -292,15 +308,10 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca
|
||||
this.segments.push(new Path_Close());
|
||||
|
||||
this.draw();
|
||||
reset();
|
||||
this.reset();
|
||||
}
|
||||
|
||||
this.reset = function()
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
function reset()
|
||||
{
|
||||
from = null;
|
||||
to = null;
|
||||
@ -313,6 +324,16 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca
|
||||
cursor_end.style.top = -100;
|
||||
}
|
||||
|
||||
this.clear = function()
|
||||
{
|
||||
this.reset();
|
||||
this.segments = [];
|
||||
this.thickness = 10
|
||||
this.linecap = "square"
|
||||
this.color = "#000000"
|
||||
this.draw();
|
||||
}
|
||||
|
||||
this.erase = function()
|
||||
{
|
||||
if(from || to || end){
|
||||
|
@ -14,6 +14,12 @@ function Keyboard()
|
||||
return;
|
||||
}
|
||||
|
||||
// new
|
||||
if(e.key == "n" && (e.ctrlKey || e.metaKey)){
|
||||
dotgrid.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
// Reset
|
||||
if((e.key == "Backspace" || e.key == "Delete") && e.ctrlKey && e.shiftKey){
|
||||
e.preventDefault();
|
||||
|
@ -20,6 +20,6 @@ function Pos(x,y)
|
||||
|
||||
this.is_equal = function(pos2)
|
||||
{
|
||||
return pos2.x == this.x && pos2.y == this.y;
|
||||
return Math.abs(pos2.x) == Math.abs(this.x) && Math.abs(pos2.y) == Math.abs(this.y);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user