aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomedit/MPanel.java4
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/MPanel.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/MPanel.java
index a7bb008e..88b918cf 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/MPanel.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/MPanel.java
@@ -19,7 +19,7 @@ public class MPanel {
protected List<MPanel> childComponents = new ArrayList<MPanel>();
- protected Color backgroundColor;
+ protected Color backgroundColor = new Color(0,0,0,0);
@Getter(AccessLevel.PUBLIC)
protected boolean isFocused;
@@ -109,7 +109,7 @@ public class MPanel {
public void clip(ScaledResolution resolution, int x, int y, int width, int height) {
int scale = resolution.getScaleFactor();
- GL11.glScissor((x ) * scale, Minecraft.getMinecraft().displayHeight - (y + height) * scale, (width + x) * scale, height * scale);
+ GL11.glScissor((x ) * scale, Minecraft.getMinecraft().displayHeight - (y + height) * scale, (width) * scale, height * scale);
}
private Rectangle determineClip(Rectangle rect1, Rectangle rect2) {
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java
index 430ca07f..c77cb947 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java
@@ -18,9 +18,10 @@ public class MButton extends MPanel {
private Color foreground = Color.white;
private Color hover = Color.gray;
+ private Color clicked = Color.lightGray;
private Color disabled = Color.darkGray;
- private boolean enabled;
+ private boolean enabled = true;
private Runnable onActionPerformed;
@@ -34,7 +35,8 @@ public class MButton extends MPanel {
} else if (new Rectangle(new Point(0,0),bounds).contains(relMousex0, relMousey0)) {
bg = hover;
}
- Gui.drawRect(0,0,bounds.width, bounds.height, bg.getRGB());
+ if (bg != null)
+ Gui.drawRect(0,0,bounds.width, bounds.height, bg.getRGB());
FontRenderer renderer = Minecraft.getMinecraft().fontRendererObj;
int width = renderer.getStringWidth(text);