MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / setBackgroundTexture

Method setBackgroundTexture

Minecraft-Utils/1.12/src/GuiList.java:702–723  ·  view source on GitHub ↗
(Object backgroundTexture, int imageWidth, int imageHeight)

Source from the content-addressed store, hash-verified

700 }
701
702 @Override
703 public void setBackgroundTexture(Object backgroundTexture, int imageWidth, int imageHeight) {
704 this.backgroundTexture = backgroundTexture;
705
706 if (backgroundTexture != null) {
707 double w = imageWidth;
708 double h = imageHeight;
709 int listWidth = getRight() - getLeft();
710 int listHeight = getBottom() - getTop();
711
712 while (w > listWidth && h > listHeight) {
713 w -= 1;
714 h -= h / w;
715 }
716 while (w < listWidth || h < listHeight) {
717 w += 1;
718 h += h / w;
719 }
720 this.backgroundWidth = (int) w;
721 this.backgroundHeight = (int) h;
722 }
723 }
724
725 @Override
726 public List<E> getRows() {

Callers

nothing calls this directly

Calls 4

getRightMethod · 0.95
getLeftMethod · 0.95
getBottomMethod · 0.95
getTopMethod · 0.95

Tested by

no test coverage detected