Fix mouse position calculation

This commit is contained in:
D-Cysteine committed 2021-09-08 23:54:01 -06:00
1 parent 3c6f425817
commit 858c0c663f
2 files changed
+4 -4

No files matched your search

@@ -125,7 +125,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler
{
Point mouse = GuiDraw.getMousePosition();
Point offset = guiRecipe.getRecipePosition(recipe);
Point relMouse = new Point(mouse.x - ((guiRecipe.width - 176) / 2) - offset.x, mouse.y - ((guiRecipe.height - 166) / 2) - offset.y);
Point relMouse = new Point(mouse.x - guiRecipe.guiLeft - offset.x, mouse.y - guiRecipe.guiTop - offset.y);
if (crecipe.getFluidTanks() != null)
{
@@ -184,9 +184,9 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler
protected boolean transferFluidTank (GuiRecipe guiRecipe, int recipe, boolean usage)
{
CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe);
Point mousepos = GuiDraw.getMousePosition();
Point mouse = GuiDraw.getMousePosition();
Point offset = guiRecipe.getRecipePosition(recipe);
Point relMouse = new Point(mousepos.x - ((guiRecipe.width - 176) / 2) - offset.x, mousepos.y - ((guiRecipe.height - 166) / 2) - offset.y);
Point relMouse = new Point(mouse.x - guiRecipe.guiLeft - offset.x, mouse.y - guiRecipe.guiTop - offset.y);
if (crecipe.getFluidTanks() != null)
{