Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
DrawingExtensions.cs
1using System.Drawing;
2
4
8public static class DrawingExtensions
9{
16 public static Rectangle ToPixelAlignedRect(this RectangleF rectF)
17 {
18 if (rectF.IsEmpty)
19 return Rectangle.Empty;
20
21 int x = (int)Math.Floor(rectF.X);
22 int y = (int)Math.Floor(rectF.Y);
23 int right = (int)Math.Ceiling(rectF.Right);
24 int bottom = (int)Math.Ceiling(rectF.Bottom);
25
26 return Rectangle.FromLTRB(x, y, right, bottom);
27 }
28}