From 7c3141822a282e8105617d9d0fa34f65886a58a7 Mon Sep 17 00:00:00 2001 From: "H. Utku Maden" Date: Mon, 5 Jan 2026 22:34:34 +0300 Subject: [PATCH] Add image brushes as a construct, as well as move some resource types to Common assembly. --- Dashboard.Common/Drawing/Brush.cs | 12 ++++++++++++ {Dashboard => Dashboard.Common}/Drawing/Font.cs | 0 {Dashboard => Dashboard.Common}/Drawing/Image.cs | 0 3 files changed, 12 insertions(+) rename {Dashboard => Dashboard.Common}/Drawing/Font.cs (100%) rename {Dashboard => Dashboard.Common}/Drawing/Image.cs (100%) diff --git a/Dashboard.Common/Drawing/Brush.cs b/Dashboard.Common/Drawing/Brush.cs index 956f77a..9cf3a7f 100644 --- a/Dashboard.Common/Drawing/Brush.cs +++ b/Dashboard.Common/Drawing/Brush.cs @@ -1,4 +1,5 @@ using System.Drawing; +using System.Numerics; namespace Dashboard.Drawing { @@ -10,4 +11,15 @@ namespace Dashboard.Drawing { public Color Color { get; } = color; } + + public class ImageBrush(Image image) : Brush + { + public Box2d TextureCoordinates { get; set; } = new Box2d(0, 0, 1, 1); + } + + public class NinePatchImageBrush(Image image) : Brush + { + public Box2d CenterCoordinates { get; set; } = new Box2d(0, 0, 1, 1); + public Vector4 Extents { get; set; } = Vector4.Zero; + } } diff --git a/Dashboard/Drawing/Font.cs b/Dashboard.Common/Drawing/Font.cs similarity index 100% rename from Dashboard/Drawing/Font.cs rename to Dashboard.Common/Drawing/Font.cs diff --git a/Dashboard/Drawing/Image.cs b/Dashboard.Common/Drawing/Image.cs similarity index 100% rename from Dashboard/Drawing/Image.cs rename to Dashboard.Common/Drawing/Image.cs