package ru.dbotthepony.mc.otm.compat.jei

import mezz.jei.api.gui.drawable.IDrawable
import net.minecraft.client.gui.GuiGraphics
import ru.dbotthepony.mc.otm.client.render.StretchingRectangleElement

class StretchingDrawable(val element: StretchingRectangleElement, val rectWidth: Int, val rectHeight: Int) : IDrawable {
	override fun getWidth(): Int {
		return rectWidth
	}

	override fun getHeight(): Int {
		return rectHeight
	}

	override fun draw(graphics: GuiGraphics, xOffset: Int, yOffset: Int) {
		element.render(graphics, xOffset.toFloat(), yOffset.toFloat(), rectWidth.toFloat(), rectHeight.toFloat())
	}
}
