Improved brush
This commit is contained in:
@@ -8,11 +8,18 @@ function Pointer(offset = new Position(), color = new Color('000000'))
|
||||
|
||||
// Parameters
|
||||
|
||||
this.actual_thickness = 0;
|
||||
|
||||
this.thickness = function()
|
||||
{
|
||||
var ratio = 10/this.position().distance_to(this.position_prev[0]);
|
||||
ratio = ratio > 1 ? 1 : ratio;
|
||||
return parseInt(ronin.brush.settings["size"]) * ratio;
|
||||
var target = parseFloat(ronin.brush.settings["size"]) * ratio;
|
||||
|
||||
if(this.actual_thickness < target){ this.actual_thickness += 0.4; }
|
||||
if(this.actual_thickness > target){ this.actual_thickness -= 0.4; }
|
||||
|
||||
return this.actual_thickness;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -70,8 +70,8 @@ function Layer(name,manager = null)
|
||||
|
||||
this.fill = function(params,preview = false)
|
||||
{
|
||||
if(preview){ return; }
|
||||
if(!params.color()){ return; }
|
||||
if(!params.color()){ return 0, "Color?"; }
|
||||
if(preview){ return 0, "No Preview"; }
|
||||
|
||||
var rect = params.rect() ? params.rect() : new Rect(this.element.width+"x"+this.element.height);
|
||||
var position = params.position() ? params.position() : new Position("0,0");
|
||||
|
||||
@@ -119,6 +119,11 @@ function Terminal(rune)
|
||||
this.syntax_highlight = function(line)
|
||||
{
|
||||
var line = line;
|
||||
|
||||
console.log(line[0])
|
||||
|
||||
// Comment
|
||||
if(line[0] == "~"){ line = "<span class='comment'>"+line+"</span>"; }
|
||||
|
||||
// Method
|
||||
if(line.indexOf(".") > 0){
|
||||
|
||||
Reference in New Issue
Block a user