Skip to content

Commit

Permalink
Fix codacy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
NATSUME Hiroaki committed May 10, 2024
1 parent 98fc321 commit e28837b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Tunny/Component/Input/TunnyValueList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Tunny.Component.Util
{
public class TunnyValueList : GH_ValueList
{
public TunnyValueList() : base()
public TunnyValueList()
{
Category = "Tunny";
SubCategory = "Input";
Expand Down Expand Up @@ -78,26 +78,26 @@ public TunnyValueListAttributes(GH_ValueList owner) : base(owner)

protected override void Render(GH_Canvas canvas, Graphics graphics, GH_CanvasChannel channel)
{
switch (channel)
if (channel == GH_CanvasChannel.Objects)
{
case GH_CanvasChannel.Objects:
DrawObjects(canvas, graphics, channel);
break;
default:
base.Render(canvas, graphics, channel);
break;
DrawObjects(canvas, graphics, channel);
}
else
{
base.Render(canvas, graphics, channel);
}
}

private void DrawObjects(GH_Canvas canvas, Graphics graphics, GH_CanvasChannel channel)
{
var style = new GH_PaletteStyle(Color.CornflowerBlue, Color.DarkBlue, Color.Black);
var tunnyStyle = new GH_PaletteStyle(Color.CornflowerBlue, Color.DarkBlue, Color.Black);

GH_PaletteStyle normalStyle = GH_Skin.palette_normal_standard;
GH_PaletteStyle warningStyle = GH_Skin.palette_warning_standard;
GH_PaletteStyle hiddenStyle = GH_Skin.palette_hidden_standard;
GH_Skin.palette_normal_standard = style;
GH_Skin.palette_warning_standard = style;
GH_Skin.palette_hidden_standard = style;
GH_Skin.palette_normal_standard = tunnyStyle;
GH_Skin.palette_warning_standard = tunnyStyle;
GH_Skin.palette_hidden_standard = tunnyStyle;
base.Render(canvas, graphics, channel);
GH_Skin.palette_normal_standard = normalStyle;
GH_Skin.palette_warning_standard = warningStyle;
Expand Down

0 comments on commit e28837b

Please sign in to comment.