Skip to content

Commit

Permalink
UI margin tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
coltonk9043 committed Dec 9, 2024
1 parent 72128ed commit b3cd7fc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/main/java/net/aoba/gui/components/BlocksComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public BlocksComponent(BlocksSetting setting) {
this.text = setting.displayName;
blocks = setting;

this.setMargin(new Margin(4f, null, 4f, null));
this.setMargin(new Margin(8f, 2f, 8f, 2f));
}

@Override
Expand All @@ -73,8 +73,8 @@ public void measure(Size availableSize) {
else
preferredSize = new Size(availableSize.getWidth(), EXPANDED_HEIGHT);

visibleColumns = (int) Math.floor((preferredSize.getWidth()) / BLOCK_WIDTH) - 1;
visibleRows = (int) Math.floor((preferredSize.getHeight() - 25) / BLOCK_WIDTH);
visibleColumns = (int) Math.floor((preferredSize.getWidth()) / (BLOCK_WIDTH + BLOCK_MARGIN));
visibleRows = (int) Math.floor((preferredSize.getHeight() - 25) / (BLOCK_WIDTH + BLOCK_MARGIN));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/aoba/gui/components/ListComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ public class ListComponent extends Component implements MouseClickListener {

public ListComponent(List<String> itemsSource) {
super();
this.setMargin(new Margin(2f, null, 2f, null));
this.setMargin(new Margin(8f, 2f, 8f, 2f));
this.itemsSource = itemsSource;
}

public ListComponent(List<String> itemsSource, StringSetting listSetting) {
super();
this.listSetting = listSetting;
this.setMargin(new Margin(2f, null, 2f, null));
this.setMargin(new Margin(8f, 2f, 8f, 2f));
this.itemsSource = itemsSource;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/aoba/gui/components/ModuleComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public ModuleComponent(Module module) {
this.header = module.getName();
this.module = module;
this.tooltip = module.getDescription();
this.setMargin(new Margin(8f, null, 8f, null));
this.setMargin(new Margin(8f, 2f, 8f, 2f));
}

@Override
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/net/aoba/utils/render/Render2D.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.aoba.AobaClient;
import net.aoba.gui.Rectangle;
import net.aoba.gui.colors.Color;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gl.ShaderProgramKeys;
import net.minecraft.client.gui.DrawContext;
Expand Down Expand Up @@ -699,7 +698,6 @@ public static void drawVerticalGradient(Matrix4f matrix4f, float x, float y, flo
* @param y Y position to draw the item.
*/
public static void drawItem(DrawContext drawContext, ItemStack stack, float x, float y) {
MinecraftClient MC = MinecraftClient.getInstance();
drawContext.drawItem(stack, (int) x, (int) y);
}

Expand Down

0 comments on commit b3cd7fc

Please sign in to comment.