Skip to content

Commit

Permalink
fixed scalefactor issue with WorldToScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
1zun4 committed Dec 26, 2023
1 parent d9cb1d4 commit ed977cb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ object WorldToScreen: Listenable {
Vector3f()
)

val guiScaleMul = 0.5f / mc.options.guiScale.value.toFloat()
val scaleFactor = mc.window.scaleFactor
val guiScaleMul = 0.5f / scaleFactor.toFloat()

val screenPos = transformedPos.mul(1.0F, -1.0F, 1.0F).add(1.0F, 1.0F, 0.0F)
.mul(guiScaleMul * mc.framebuffer.viewportWidth, guiScaleMul * mc.framebuffer.viewportHeight, 1.0F)
Expand Down

0 comments on commit ed977cb

Please sign in to comment.