Skip to content

Commit

Permalink
v1.2.1
Browse files Browse the repository at this point in the history
* Fixed spray effect causing odd blackening with some colors (hopefully)
  • Loading branch information
hamstar0 committed Jun 20, 2018
1 parent b570664 commit 3a563c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Items/ColorCartridgeItem_Def.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public override void Load( TagCompound tag ) {
this.Quantity = tag.GetFloat( "paint_quantity" );
}
if( tag.ContainsKey("is_init") ) {
this.IsInitialized = tag.GetBool();
this.IsInitialized = tag.GetBool( "is_init" );
}
}

Expand Down
2 changes: 1 addition & 1 deletion Painting/Brushes/PaintBrushSpray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public float PaintAt( PaintLayer data, Color color, byte glow, float pressure_pe
return 0f;
}

float dist_pressure_percent = pressure_percent * (1f - (dist / brush_radius));
float dist_pressure_percent = MathHelper.Clamp( pressure_percent * (1f - (dist / brush_radius)), 0f, 1f );
Color existing_color = data.GetRawColorAt( tile_x, tile_y );
Color lerped_color = Color.Lerp( existing_color, color, dist_pressure_percent );

Expand Down

0 comments on commit 3a563c6

Please sign in to comment.