@@ -136,8 +136,6 @@ class BasicFontRenderer(
136136 shadow : Boolean ,
137137 shadowColor : Color ?
138138 ) {
139- val scaledPointSize = scale * regularFontInfo.atlas.size
140-
141139 if (shadow) {
142140 drawStringNow(
143141 vertexConsumer,
@@ -148,7 +146,7 @@ class BasicFontRenderer(
148146 ),
149147 x + 1 ,
150148 y + 1 ,
151- scaledPointSize ,
149+ scale ,
152150 )
153151 }
154152 drawStringNow(
@@ -158,7 +156,7 @@ class BasicFontRenderer(
158156 color,
159157 x,
160158 y,
161- scaledPointSize ,
159+ scale ,
162160 )
163161 }
164162
@@ -181,8 +179,10 @@ class BasicFontRenderer(
181179 color : Color ,
182180 x : Float ,
183181 y : Float ,
184- originalPointSize : Float
182+ scale : Float ,
185183 ) {
184+ val scaledPointSize = scale * regularFontInfo.atlas.size
185+
186186 var currentX = x
187187 var i = 0
188188 while (i < string.length) {
@@ -204,22 +204,22 @@ class BasicFontRenderer(
204204 val planeBounds = glyph.planeBounds
205205
206206 if (planeBounds != null ) {
207- val width = (planeBounds.r - planeBounds.l) * originalPointSize
208- val height = (planeBounds.t - planeBounds.b) * originalPointSize
207+ val width = (planeBounds.r - planeBounds.l) * scaledPointSize
208+ val height = (planeBounds.t - planeBounds.b) * scaledPointSize
209209
210210 drawGlyph(
211211 vertexConsumer,
212212 matrixStack,
213213 glyph,
214214 color,
215215 currentX,
216- y + regularFontInfo.atlas.baseCharHeight - planeBounds.t * originalPointSize ,
216+ y + regularFontInfo.atlas.baseCharHeight * scale - planeBounds.t * scaledPointSize ,
217217 width,
218218 height
219219 )
220220 }
221221
222- currentX + = computeAdvance(regularFontInfo, glyph) * originalPointSize
222+ currentX + = computeAdvance(regularFontInfo, glyph) * scaledPointSize
223223 i++
224224 }
225225
0 commit comments