Move Common functionality to Core project & rendering and Model support as well

This commit is contained in:
miku-666
2025-09-01 23:03:39 +02:00
parent 698056a0a0
commit 9656c8b48d
177 changed files with 5979 additions and 1279 deletions

View File

@@ -0,0 +1,37 @@
using System.Drawing;
namespace PckStudio.Core.Extensions
{
internal struct ImageSection
{
public readonly Size Size;
public readonly Point Point;
public readonly Rectangle Area;
internal ImageSection(Size originalSize, int index, ImageLayoutDirection layoutDirection)
{
switch(layoutDirection)
{
case ImageLayoutDirection.Horizontal:
{
Size = new Size(originalSize.Height, originalSize.Height);
Point = new Point(index * originalSize.Height, 0);
}
break;
case ImageLayoutDirection.Vertical:
{
Size = new Size(originalSize.Width, originalSize.Width);
Point = new Point(0, index * originalSize.Width);
}
break;
default:
Size = Size.Empty;
Point = new Point(-1, -1);
break;
}
Area = new Rectangle(Point, Size);
}
}
}