package wtf.opal.utility.misc;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

@Environment(EnvType.CLIENT)
public final class HoverUtility {
   private HoverUtility() {
   }

   public static boolean isHovering(float x, float y, float width, float height, double mouseX, double mouseY) {
      return mouseX >= (double)x && mouseY >= (double)y && mouseX < (double)(x + width) && mouseY < (double)(y + height);
   }

   public static boolean isHovering(float x, float y, float width, float height, double mouseX, double mouseY, float scaleFactor) {
      float var9 = width * scaleFactor;
      float var10 = height * scaleFactor;
      float var11 = x + (width - var9) / 2.0F;
      float var12 = y + (height - var10) / 2.0F;
      return mouseX >= (double)var11 && mouseY >= (double)var12 && mouseX < (double)(var11 + var9) && mouseY < (double)(var12 + var10);
   }
}
