Improved brush

This commit is contained in:
Devine Lu Linvega
2017-04-18 09:23:12 -10:00
parent 2fa538af30
commit a2ec49f3aa
5 changed files with 22 additions and 5 deletions

View File

@@ -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;
}
//

View File

@@ -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");

View File

@@ -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){