aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFalkreon <falkreon@gmail.com>2019-08-13 17:56:38 -0500
committerFalkreon <falkreon@gmail.com>2019-08-13 17:57:47 -0500
commit1ee7f91e873da6f904463cd89c388a2d8f64b324 (patch)
tree47b23aa708eab1f366127556bf1d3927c7b79df7 /src
parent7bf2e21f4d679c3c517fd294348631e4c750dd1f (diff)
downloadLibGui-1ee7f91e873da6f904463cd89c388a2d8f64b324.tar.gz
LibGui-1ee7f91e873da6f904463cd89c388a2d8f64b324.tar.bz2
LibGui-1ee7f91e873da6f904463cd89c388a2d8f64b324.zip
Fix several off-by-4 errors
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java8
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/CottonScreen.java2
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java b/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java
index 5a02705..8cf9d40 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java
@@ -15,12 +15,12 @@ public interface BackgroundPainter {
public static BackgroundPainter VANILLA = (left, top, panel) -> {
- ScreenDrawing.drawGuiPanel(left-8, top-8, panel.getWidth()+14, panel.getHeight()+14);
+ ScreenDrawing.drawGuiPanel(left-8, top-8, panel.getWidth()+16, panel.getHeight()+16);
};
public static BackgroundPainter SLOT = (left, top, panel) -> {
if (!(panel instanceof WItemSlot)) {
- ScreenDrawing.drawBeveledPanel(left-1, top-1, panel.getWidth(), panel.getHeight(), 0xB8000000, 0x4C000000, 0xB8FFFFFF);
+ ScreenDrawing.drawBeveledPanel(left-1, top-1, panel.getWidth()+2, panel.getHeight()+2, 0xB8000000, 0x4C000000, 0xB8FFFFFF);
} else {
WItemSlot slot = (WItemSlot)panel;
for(int x = 0; x < slot.getWidth()/18; ++x) {
@@ -30,10 +30,10 @@ public interface BackgroundPainter {
//this will cause a slightly discolored bottom border on vanilla backgrounds but it's necessary for color support, it shouldn't be *too* visible unless you're looking for it
int hi = 0xB8FFFFFF;
if (slot.isBigSlot()) {
- ScreenDrawing.drawBeveledPanel((x * 18) + left - 4, (y * 18) + top - 4, 24, 24,
+ ScreenDrawing.drawBeveledPanel((x * 18) + left - 4, (y * 18) + top - 4, 16+8, 16+8,
lo, bg, hi);
} else {
- ScreenDrawing.drawBeveledPanel((x * 18) + left - 1, (y * 18) + top - 1, 18, 18,
+ ScreenDrawing.drawBeveledPanel((x * 18) + left - 1, (y * 18) + top - 1, 16+2, 16+2,
lo, bg, hi);
}
}
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonScreen.java
index 1034779..4caa477 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonScreen.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonScreen.java
@@ -174,7 +174,7 @@ public class CottonScreen<T extends CottonScreenController> extends AbstractCont
}
if (this.container.getRootPanel()!=null) {
- this.container.getRootPanel().paintForeground(0, 0, mouseX, mouseY);
+ this.container.getRootPanel().paintForeground(0, 0, mouseX+left, mouseY+top);
}
}
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java
index 9e8c452..4287941 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java
@@ -92,7 +92,7 @@ public class WItemSlot extends WWidget {
for (int y = 0; y < slotsHigh; y++) {
for (int x = 0; x < slotsWide; x++) {
- ValidatedSlot slot = new ValidatedSlot(inventory, index, this.getAbsoluteX() + (x * 18), this.getAbsoluteY() + (y * 18));
+ ValidatedSlot slot = new ValidatedSlot(inventory, index, this.getAbsoluteX() + (x * 18) + 1, this.getAbsoluteY() + (y * 18) + 1);
peers.add(slot);
c.addSlotPeer(slot);
index++;