using Robust.Client.Graphics; using Robust.Shared.GameObjects; using System.Numerics; namespace Robust.Client.UserInterface.CustomControls; /// /// An event used to reverse distortion effects applied by shaders. /// Used to find the map position that visible pixels originate from so that severe distortion shaders do not make interaction nigh-impossible. /// [ByRefEvent] public record struct PixelToMapEvent(Vector2 LocalPosition, IViewportControl Control, IClydeViewport Viewport) { /// /// The local position of the pixel within the that we are trying to convert to a map position. /// public readonly Vector2 LocalPosition = LocalPosition; /// /// The original (or WIP) location of the pixel within the that we are trying to convert to a map position. /// Used as the output of the event. /// public Vector2 VisiblePosition = LocalPosition; /// /// The control the pixel we are considering is located within. /// public readonly IViewportControl Control = Control; /// /// The viewport being displayed by the control we are considering. /// public readonly IClydeViewport Viewport = Viewport; }