Skip to content

Commit

Permalink
mac compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
lin-ycv committed Sep 22, 2022
1 parent ce09730 commit b01a19c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.2.0")]
[assembly: AssemblyFileVersion("0.0.2.0")]
[assembly: AssemblyVersion("0.0.3.0")]
[assembly: AssemblyFileVersion("0.0.3.0")]
8 changes: 4 additions & 4 deletions src/LabelWidget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ public override bool Visible
public LabelWidget()
{
GH_SettingsServer settings = new GH_SettingsServer("melanoplus_label", true);
var cvt = new FontConverter();
if (settings.Count > 0)
{
enabled = settings.GetValue("Enabled", false);
Exclude = new List<string>(settings.GetValue("Exclude", "").Split(','));
font = (settings.GetValue("Font", "") is string str) ? cvt.ConvertFromInvariantString(str) as Font : GH_FontServer.StandardItalic;
var fDe = settings.GetValue("Font", "").Split('|');
font = fDe.Length>0? new Font(fDe[0], float.Parse(fDe[1]), (FontStyle)Convert.ToInt32(fDe[2])) : GH_FontServer.StandardItalic;
brush.Color = settings.GetValue("Color", Color.Gray);
shownickname = settings.GetValue("Nickname", false);
}
Expand All @@ -62,7 +62,7 @@ public LabelWidget()
string Exclude_defaults = "Colour Swatch,Scribble,Panel,Value List,Button,Boolean Toggle,Number Slider,Sketch";
settings.SetValue("Enabled", enabled);
settings.SetValue("Exclude", Exclude_defaults);
settings.SetValue("Font", cvt.ConvertToInvariantString(font));
settings.SetValue("Font", string.Join("|",new string[] {font.FontFamily.Name,font.SizeInPoints.ToString(),((int)font.Style).ToString()}));
settings.WritePersistentSettings();
Exclude = new List<string>(Exclude_defaults.Split(','));
}
Expand Down Expand Up @@ -235,7 +235,7 @@ public GH_LabelSettingFrontEnd()
LabelWidget.font = fontpicker.Font;
Instances.ActiveCanvas.Refresh();
GH_SettingsServer settings = new GH_SettingsServer("melanoplus_label", true);
settings.SetValue("Font", new FontConverter().ConvertToInvariantString(LabelWidget.font));
settings.SetValue("Font", string.Join("|", new string[] { LabelWidget.font.FontFamily.Name, LabelWidget.font.SizeInPoints.ToString(), ((int)LabelWidget.font.Style).ToString() }));
settings.WritePersistentSettings();
};
input = new TextBox()
Expand Down

0 comments on commit b01a19c

Please sign in to comment.