Skip to content

Commit

Permalink
Fix rendering bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
HyCraftHD committed Apr 8, 2024
1 parent 6286f65 commit 42bc0ec
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
public class BetterScrollableList<T extends ObjectSelectionList.Entry<T>> extends ScrollableList<T> {

public BetterScrollableList(int x, int y, int width, int height, int slotHeight, int sideDistance) {
super(x, y, width, height, slotHeight, sideDistance);
super(x, y, width <= 0 ? 1 : width, height <= 0 ? 1 : height, slotHeight, sideDistance);
setRenderHeader(false, 0);
setRenderTransparentBorder(true);
}

public void updateSettings(int x, int y, int width, int height) {
setX(x);
setY(y);
setWidth(width);
setHeight(height);
setWidth(width <= 0 ? 1 : width);
setHeight(height <= 0 ? 1 : height);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected void init() {
namePlaylistField.setValue("");
});

playlistsList = new GuiMusicPlayerList(12, 90, width - 24, height);
playlistsList = new GuiMusicPlayerList(12, 90, width - 24, height - 100);
addWidget(playlistsList);

controls = new GuiControls(this, 5, width);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected void init() {
addTracksButton.active = false;
}

trackList.updateSettings(12, 50, width - 24, height);
trackList.updateSettings(12, 50, width - 24, height - 60);
trackList.addAllEntries();
addWidget(trackList);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public boolean keyPressed(int key, int p_keyPressed_2_, int p_keyPressed_3_) {
setInformation(ChatFormatting.GREEN + getTranslation(GUI_SEARCH_ADDED_ALL), 150);
});

searchList.updateSettings(12, 130, width - 24, height);
searchList.updateSettings(12, 130, width - 24, height - 140);
addWidget(searchList);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected void applyValue() {
}
});

mixerDeviceList = new GuiMusicPlayerSettingsMixerDeviceList(12, 163, width - 24, height);
mixerDeviceList = new GuiMusicPlayerSettingsMixerDeviceList(12, 163, width - 24, height - 173);
addWidget(mixerDeviceList);

controls = new GuiControls(this, 5, width);
Expand Down

0 comments on commit 42bc0ec

Please sign in to comment.