1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

egui_web: make text thicker and less pixelated (#640)

Closes https://github.com/emilk/egui/issues/516
This commit is contained in:
Emil Ernerfeldt
2021-08-21 21:18:00 +02:00
committed by GitHub
parent 12fd4906de
commit 91bdf9ba6e
5 changed files with 20 additions and 6 deletions

View File

@@ -367,7 +367,8 @@ impl crate::Painter for WebGlPainter {
}
let mut pixels: Vec<u8> = Vec::with_capacity(texture.pixels.len() * 4);
for srgba in texture.srgba_pixels() {
let font_gamma = 1.0 / 2.2; // HACK due to non-linear framebuffer blending.
for srgba in texture.srgba_pixels(font_gamma) {
pixels.push(srgba.r());
pixels.push(srgba.g());
pixels.push(srgba.b());