Fixed magnet
This commit is contained in:
parent
0ac1986b42
commit
1f70431dcb
@ -10,8 +10,6 @@ Enjoy
|
||||
Splash screen
|
||||
Hide widget on mouseover
|
||||
Add locks
|
||||
Store values in modules, experiment with vector
|
||||
Give name to settings
|
||||
Merge layers
|
||||
Export multiple layers file
|
||||
% Render
|
||||
@ -37,8 +35,6 @@ Enjoy
|
||||
Load default.rin on startup
|
||||
* Eye
|
||||
Swatches, handle all colors
|
||||
+ Path
|
||||
Rename vector to Path
|
||||
|
||||
|
||||
this.collection = {};
|
||||
|
0
presets/default.rin
Normal file
0
presets/default.rin
Normal file
@ -3,6 +3,9 @@ function Layer(name,manager = null)
|
||||
Module.call(this,"#");
|
||||
|
||||
this.add_method(new Method("fill",["color","position","rect"],"Add position"));
|
||||
this.add_method(new Method("rotate",["position","angle"]));
|
||||
this.add_method(new Method("resize",["position","rect"]));
|
||||
this.add_method(new Method("mirror",["position"]));
|
||||
this.add_method(new Method("rename",["text"]));
|
||||
|
||||
this.name = name;
|
||||
|
@ -4,32 +4,21 @@ function Magnet(rune)
|
||||
|
||||
this.settings = {"grid" : new Rect("1x1"), "marker": new Position("4,4"), "reset" : new Bang()};
|
||||
|
||||
this.passive = function(cmd)
|
||||
this.add_method(new Method("grid",["rect","position"]));
|
||||
|
||||
this.grid = function(params,preview = false)
|
||||
{
|
||||
if(!params.rect()){ return; }
|
||||
|
||||
if(!this.layer){ this.create_layer(); }
|
||||
|
||||
this.layer.clear();
|
||||
this.draw_grid(cmd.setting("grid"),cmd.setting("marker"));
|
||||
}
|
||||
this.draw_grid(params.rect(),params.position());
|
||||
|
||||
this.active = function(cmd)
|
||||
{
|
||||
if(cmd.bang()){
|
||||
if(this.layer){ this.layer.remove(this); }
|
||||
return;
|
||||
if(preview == false){
|
||||
this.settings["grid"] = params.rect();
|
||||
this.settings["market"] = params.position();
|
||||
}
|
||||
|
||||
if(!this.layer){ this.create_layer(); }
|
||||
|
||||
this.layer.clear();
|
||||
this.draw_grid(this.settings["grid"],this.settings["marker"]);
|
||||
}
|
||||
|
||||
this.context = function()
|
||||
{
|
||||
if(!this.layer){ this.create_layer(); }
|
||||
|
||||
return this.layer.context();
|
||||
}
|
||||
|
||||
this.draw_grid = function(rect,grid)
|
||||
|
@ -4,7 +4,7 @@ function Source(rune)
|
||||
|
||||
this.parameters = [Filepath,Position,Rect];
|
||||
|
||||
this.add_method(new Method("save",["name"],"Add point"));
|
||||
this.add_method(new Method("save",["name","rect","format"]));
|
||||
this.add_method(new Method("load",["path","position","rect"]),"Add point");
|
||||
|
||||
this.load = function(params,preview = false) // source.load ../assets/todo.jpg 200x200 40,40
|
||||
|
Loading…
x
Reference in New Issue
Block a user