Skip to content

Commit 2b78b72

Browse files
committed
Update GLRendererImpl.kt
1 parent 641a8cb commit 2b78b72

File tree

1 file changed

+6
-5
lines changed
  • modules/ui/src/main/kotlin/org/polyfrost/oneconfig/api/ui/v1/internal

1 file changed

+6
-5
lines changed

modules/ui/src/main/kotlin/org/polyfrost/oneconfig/api/ui/v1/internal/GLRendererImpl.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,10 @@ class GLRendererImpl(private val nsvg: NanoSvgApi, private val stb: StbApi) : Re
363363
require("GL_EXT_gpu_shader4" in extensions) { "GL_EXT_gpu_shader4 is not supported and is required" }
364364
require("GL_ARB_instanced_arrays" in extensions) { "GL_ARB_instanced_arrays is not supported and is required" }
365365
require("GL_ARB_draw_instanced" in extensions) { "GL_ARB_draw_instanced is not supported and is required" }
366-
// if ("GL_EXT_framebuffer_object" in extensions) {
367-
// LOGGER.info("Using mipmaps as extension GL_EXT_framebuffer_object is available")
368-
// mipmapMode = 2
369-
// }
366+
if ("GL_EXT_framebuffer_object" in extensions) {
367+
LOGGER.info("Using mipmaps as extension GL_EXT_framebuffer_object is available")
368+
mipmapMode = 2
369+
}
370370
}
371371
}
372372

@@ -680,7 +680,7 @@ class GLRendererImpl(private val nsvg: NanoSvgApi, private val stb: StbApi) : Re
680680

681681
var penX = x
682682
val scaleFactor = fontSize / fAtlas.renderedSize
683-
val penY = y + (fAtlas.ascent + fAtlas.descent) * scaleFactor
683+
val penY = (y + (fAtlas.ascent + fAtlas.descent) * scaleFactor) + 2f
684684
val col = java.lang.Float.intBitsToFloat(color.argb.capAlpha())
685685
val buffer = buffer
686686

@@ -948,6 +948,7 @@ class GLRendererImpl(private val nsvg: NanoSvgApi, private val stb: StbApi) : Re
948948

949949
private fun getFontAtlas(font: Font, fontSize: Float): FontAtlas {
950950
val renderSize = when (fontSize) {
951+
in 0f..16f -> 6f
951952
in 0f..36f -> 24f
952953
else -> 48f
953954
}

0 commit comments

Comments
 (0)