Skip to content

Commit

Permalink
Fix description not saving (#59)
Browse files Browse the repository at this point in the history
* fix required level being limited to 5

* fixed description object not saving on edit
  • Loading branch information
krogenth authored Dec 27, 2023
1 parent 5cc0884 commit 16e161d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/G2DataGUI.Common/Data/Common/FixedLengthDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public string Description
string description = "";
foreach (var character in _characters)
{
description += Convert.ToChar(character);
description += character > 0 ? Convert.ToChar(character) : ' ';
}

return description.TrimEnd();
Expand All @@ -25,7 +25,7 @@ public string Description
value = value.PadRight((int)MaxLength, ' ');
for (int index = 0; index < MaxLength; index++)
{
_characters[index] = Convert.ToByte(_characters[index]);
_characters[index] = Convert.ToByte(value[index]);
}
}
}
Expand All @@ -43,4 +43,4 @@ public void WriteFixedLengthDescription(Stream writer) =>
writer.WriteRawByteArray(_characters);

public static uint MaxLength { get => 40; }
}
}
2 changes: 1 addition & 1 deletion src/G2DataGUI.Common/Data/Common/FixedLengthName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public string Name
}
set
{
value = value.PadRight((int)MaxLength, ' ');
value = value.PadLeft((int)MaxLength, ' ');
for (int index = 0; index < MaxLength; index++)
{
_characters[index] = Convert.ToByte(value[index]);
Expand Down

0 comments on commit 16e161d

Please sign in to comment.