From 3b54cef2825fc142d6419fa185884dc8d96081f6 Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Tue, 22 Oct 2024 02:12:59 +0200 Subject: [PATCH] fix bug introduced in #42 --- .../neicustomdiagram/api/draw/scroll/ScrollManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/api/draw/scroll/ScrollManager.java b/src/main/java/com/github/dcysteine/neicustomdiagram/api/draw/scroll/ScrollManager.java index fcd49c4..a9adbbb 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/api/draw/scroll/ScrollManager.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/api/draw/scroll/ScrollManager.java @@ -112,8 +112,8 @@ public Point getRelativeMousePosition(int recipe) { java.awt.Point mouse = GuiDraw.getMousePosition(); java.awt.Point offset = gui.getRecipePosition(recipe); - int x = mouse.x + horizontalScrollbar.getScroll() - gui.guiLeft + offset.x; - int y = mouse.y + verticalScrollbar.getScroll() - gui.guiTop + offset.y; + int x = mouse.x + horizontalScrollbar.getScroll() - (gui.guiLeft + offset.x); + int y = mouse.y + verticalScrollbar.getScroll() - (gui.guiTop + offset.y); return Point.create(x, y); }