using System; using System.Drawing; namespace Pilz.UI; public class PaintingObjectPaintEventArgs(PaintingObject obj, Graphics g, PointF offset) : EventArgs { /// /// The Painting Object to draw. /// /// public PaintingObject PaintingObject { get; } = obj; /// /// The current offset of the page on the screen. /// /// public PointF Offset { get; } = offset; /// /// The Grpahics from the parent PaintingControl. /// /// public Graphics Graphics { get; } = g; /// /// The position of the PaintingObject on Screen. /// /// public PointF Location => new(X, Y); /// /// The X position of the PaintingObject on Screen. /// /// public float X => PaintingObject.X - Offset.X; /// /// The Y position of the PaintingObject on Screen. /// /// public float Y => PaintingObject.Y - Offset.Y; /// /// The rectangle of the PaintingObject on Screen. /// /// public RectangleF Rectangle => new RectangleF(X, Y, PaintingObject.Width, PaintingObject.Height); public PaintingObjectPaintEventArgs(PaintingObject obj, Graphics g) : this(obj, g, obj.Parent.Offset) { } }