You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when using a texturepack with a higher resolution, the scrollbar thumb is just drawn as is—without respect to its expected size—breaching its bounds.
I found this in version 1.20.4 (neoforge-17.13.0-beta), but the code suggests it behaves the same in newer versions (this line would need to be changed)
It's quite funny to use, as the hitbox also gets larger.
Example
(Image is fabricated, as I already fixed it at this point and didn't want to redownload the old mod ^^)
Solution
I already came up with a fix, using hardcoded dimensions (which I found kinda "sus", but the Vanilla code did the same, so should be fine 🤷; it does respect UI-Scaling).
There is no PR, because I didn't know on which branch to push my changes for an older version, but I've outlined the changes below. If you want me to push it to somewhere, just give me a notice!
Additionally, these changes are required to reflect the name-changes in the Style class and to draw the Thumb with the correct size in drawForegroundLayer:
@OverridepublicRect2igetBounds() {
returnnewRect2i(displayX, displayY, style.width, height); // add the width here
}
@OverridepublicvoiddrawForegroundLayer(GuiGraphicsguiGraphics, Rect2ibounds, Pointmouse) {
...
image.dest(this.displayX, this.displayY + yOffset, style.width, style.height).blit(guiGraphics); // respect the expected dimensions here
}
privateintgetHandleYOffset() {
...
intavailableHeight = this.height - style.height; // use the new height here
...
}
@OverridepublicbooleanonMouseDown(PointmousePos, intbutton) {
...
} elseif (relY < handleYOffset + style.height) { // use the new height here
...
} else {
...
}
returntrue;
}
@OverridepublicbooleanonMouseDrag(PointmousePos, intbutton) {
...
doubleavailableHeight = this.height - style.height; // use the new height here
...
}
Describe the bug
hey,
when using a texturepack with a higher resolution, the scrollbar thumb is just drawn as is—without respect to its expected size—breaching its bounds.
I found this in version 1.20.4 (neoforge-17.13.0-beta), but the code suggests it behaves the same in newer versions (this line would need to be changed)
It's quite funny to use, as the hitbox also gets larger.
Example
(Image is fabricated, as I already fixed it at this point and didn't want to redownload the old mod ^^)
Solution
I already came up with a fix, using hardcoded dimensions (which I found kinda "sus", but the Vanilla code did the same, so should be fine 🤷; it does respect UI-Scaling).
There is no PR, because I didn't know on which branch to push my changes for an older version, but I've outlined the changes below. If you want me to push it to somewhere, just give me a notice!
All changes are to Scrollbar.java
I propose the following change to
Style
:Additionally, these changes are required to reflect the name-changes in the Style class and to draw the Thumb with the correct size in
drawForegroundLayer
:Here's a
git patch
, if that is easier for youRespect_texture-resolution_in_Scrollbar-Thumb.patch
How to reproduce the bug
Use a resource pack with 2x/4x UI (e.g.: BDcraft 64x)
Expected behavior
Scrollbar thumb gets big and uggly
Additional details
No response
Which minecraft version are you using?
1.20
On which mod loaders does it happen?
NeoForge
Crash log
there is no crash
The text was updated successfully, but these errors were encountered: