Skip to content

Commit

Permalink
Fix 'static-scale'
Browse files Browse the repository at this point in the history
  • Loading branch information
toxicity188 committed Jan 2, 2025
1 parent 39844c7 commit ad55766
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/1.11.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
```
world (bukkit)
```
- These configuration added
```
force-split: false (Text layout)
frame-type: local #global, local (Popup)
```

### Fix
- Fix shaders bug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ object ShaderManagerImpl : BetterHudManager, ShaderManager {
fun applyScale(offset: Int, scale: Double, pos: String) {
if (scale != 1.0 || static) {
val scaleFloat = scale.toFloat()
add(" pos.$pos = (pos.$pos - (${offset})) * ${if (static) "$scaleFloat * ui.$pos / ScreenSize.$pos" else scaleFloat} + (${offset});")
add(" pos.$pos = (pos.$pos - (${offset})) * ${if (static) "$scaleFloat * uiScreen.$pos" else scaleFloat} + (${offset} * uiScreen.$pos);")
}
}
applyScale(shader.renderScale.relativeOffset.x, shader.renderScale.scale.x, "x")
Expand Down
1 change: 1 addition & 0 deletions dist/src/main/resources/text.vsh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ float getDistance(mat4 modelViewMat, vec3 pos, int shape) {
void main() {
vec3 pos = Position;
vec2 ui = ceil(2 / vec2(ProjMat[0][0], -ProjMat[1][1]));
vec2 uiScreen = ui / ScreenSize;
vec3 color = Color.xyz;
vertexColor = Color * texelFetch(Sampler2, UV2 / 16, 0);
applyColor = 0;
Expand Down

0 comments on commit ad55766

Please sign in to comment.