Skip to content

Commit

Permalink
fix(Legend): support Embed bool
Browse files Browse the repository at this point in the history
  • Loading branch information
MingboPeng committed Apr 5, 2024
1 parent f208541 commit 53921a3
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/LadybugDisplaySchema/ManualAdded/Model/LegendParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,33 @@ private Legend3DParameters init3DDefault()

//public System.Drawing.Rectangle GetBoundary => new System.Drawing.Rectangle(this.X, this.Y, this.Width, this.Height);

public LegendParameters SetEmbed(bool ifEmbed)
{
var dic = this.GetUserData();

if (ifEmbed)
dic.TryAddUpdate("_embed", ifEmbed);
else if (dic.ContainsKey("_embed"))
{
dic.Remove("_embed");
}
this.UserData = dic;
return this;
}
public bool IsEmbedded()
{
var dic = this.GetUserData();
if (dic.TryGetValue("_embed", out var cached) )
{
if (cached is bool ifCached) return ifCached;
else if (cached?.ToString()?.ToLower() == "true")
return true;

}

return false;
}

public LegendParameters SetNoneColor(Color color)
{
return this.AddUserData("_noneColor", color);
Expand Down

0 comments on commit 53921a3

Please sign in to comment.