Skip to content

Commit eb52a4b

Browse files
committed
font nit
1 parent 44a7307 commit eb52a4b

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

src/main/kotlin/com/lambda/graphics/renderer/gui/FontRenderer.kt

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ import com.lambda.util.math.MathUtils.toInt
3131
import com.lambda.util.math.Vec2d
3232
import com.lambda.util.math.a
3333
import com.lambda.util.math.setAlpha
34+
import net.minecraft.client.gui.hud.ChatHud.getHeight
35+
import sun.java2d.SunGraphicsEnvironment.getScaleFactor
3436
import java.awt.Color
3537

3638
/**
@@ -105,9 +107,7 @@ object FontRenderer : AbstractGUIRenderer(VertexAttrib.Group.FONT, shader("rende
105107
val pos1 = Vec2d(0.0, posY) * actualScale
106108
val pos2 = pos1 + scaledSize
107109

108-
upload {
109-
buildGlyph(glyph, position, pos1, pos2, color)
110-
}
110+
upload { buildGlyph(glyph, position, pos1, pos2, color) }
111111
}
112112

113113
/**
@@ -131,20 +131,12 @@ object FontRenderer : AbstractGUIRenderer(VertexAttrib.Group.FONT, shader("rende
131131
val x2 = pos2.x + origin.x
132132
val y2 = pos2.y + origin.y
133133

134-
buildQuad(
135-
vertex {
136-
vec3m(x1, y1).vec2(glyph.uv1.x, glyph.uv1.y).color(color)
137-
},
138-
vertex {
139-
vec3m(x1, y2).vec2(glyph.uv1.x, glyph.uv2.y).color(color)
140-
},
141-
vertex {
142-
vec3m(x2, y2).vec2(glyph.uv2.x, glyph.uv2.y).color(color)
143-
},
144-
vertex {
145-
vec3m(x2, y1).vec2(glyph.uv2.x, glyph.uv1.y).color(color)
146-
}
147-
)
134+
val upLeft = vertex { vec3m(x1, y1).vec2(glyph.uv1.x, glyph.uv1.y).color(color) }
135+
val downLeft = vertex { vec3m(x1, y2).vec2(glyph.uv1.x, glyph.uv2.y).color(color) }
136+
val upRight = vertex { vec3m(x2, y2).vec2(glyph.uv2.x, glyph.uv2.y).color(color) }
137+
val downRight = vertex { vec3m(x2, y1).vec2(glyph.uv2.x, glyph.uv1.y).color(color) }
138+
139+
buildQuad(upLeft, downLeft, upRight, downRight)
148140
}
149141

150142
/**

0 commit comments

Comments
 (0)