package speiger.src.coreengine.rendering.guiOld.helper.constrains;

public class RelativeConstrain extends Constrain
{
	float value;
	float padding = 0F;
	
	public RelativeConstrain(float value)
	{
		this.value = value;
	}
	
	public RelativeConstrain setPadding(float padding)
	{
		this.padding = padding;
		return this;
	}
	
	@Override
	public void apply()
	{
		set(value * (get(target.toWidth()) - padding));
	}
}
