using System;
using System.Drawing;
using Decal.Adapter.Support;
using Decal.Interop.Core;
using Decal.Interop.Render;

namespace Decal.Adapter.Wrappers;

[CLSCompliant(true)]
public class HudRenderScalable : HudRenderTarget
{
	private IRenderScalable myScalable;

	public Rectangle ScaleRect => Util.toRectangle(myScalable.ScaleRect);

	public float ScaleFactor
	{
		get
		{
			return myScalable.ScaleFactor;
		}
		set
		{
			myScalable.ScaleFactor = value;
		}
	}

	public bool Scaling
	{
		get
		{
			return myScalable.Scaling;
		}
		set
		{
			myScalable.Scaling = value;
		}
	}

	[CLSCompliant(false)]
	protected HudRenderScalable(IRenderScalable newTarget)
		: base(newTarget)
	{
		myScalable = newTarget;
	}

	public void ScaleTo(Rectangle rect)
	{
		tagRECT pArea = Util.toTagRECT(rect);
		myScalable.ScaleTo(ref pArea);
	}
}
