Skip to content

Commit

Permalink
use Math.Ceiling for floats
Browse files Browse the repository at this point in the history
  • Loading branch information
ActualMandM committed Jun 27, 2024
1 parent 8f151e5 commit f171415
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ public static void ProcessImage(string file)

foreach (XmlNode node in doc.DocumentElement.SelectNodes("SubTexture"))
{
padding = Math.Min(padding, (int)float.Parse(node.Attributes["x"].Value));
maxX = Math.Max(maxX, (int)float.Parse(node.Attributes["x"].Value) + (int)float.Parse(node.Attributes["width"].Value));
maxY = Math.Max(maxY, (int)float.Parse(node.Attributes["y"].Value) + (int)float.Parse(node.Attributes["height"].Value));
padding = Math.Min(padding, (int)Math.Ceiling(float.Parse(node.Attributes["x"].Value)));
maxX = Math.Max(maxX, (int)Math.Ceiling(float.Parse(node.Attributes["x"].Value)) + (int)Math.Ceiling(float.Parse(node.Attributes["width"].Value)));
maxY = Math.Max(maxY, (int)Math.Ceiling(float.Parse(node.Attributes["y"].Value)) + (int)Math.Ceiling(float.Parse(node.Attributes["height"].Value)));
}

maxX += padding;
Expand Down
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 @@
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.3.0")]

0 comments on commit f171415

Please sign in to comment.