renderer: do not constrain color glyphs

There is no reason to and I do not know where this assumption came from.
It's very possible for a colored glyph to (intentionally!) exceed the
cell bounds, and we shouldn't be stopping this...
This commit is contained in:
Qwerasd
2024-12-19 11:21:57 -05:00
parent e7ca135af1
commit 4ca6413ec9
2 changed files with 2 additions and 6 deletions

View File

@ -256,9 +256,7 @@ vertex CellTextVertexOut cell_text_vertex(
offset.y = uniforms.cell_size.y - offset.y; offset.y = uniforms.cell_size.y - offset.y;
// If we're constrained then we need to scale the glyph. // If we're constrained then we need to scale the glyph.
// We also always constrain colored glyphs since we should have if (in.mode == MODE_TEXT_CONSTRAINED) {
// their scaled cell size exactly correct.
if (in.mode == MODE_TEXT_CONSTRAINED || in.mode == MODE_TEXT_COLOR) {
float max_width = uniforms.cell_size.x * in.constraint_width; float max_width = uniforms.cell_size.x * in.constraint_width;
if (size.x > max_width) { if (size.x > max_width) {
float new_y = size.y * (max_width / size.x); float new_y = size.y * (max_width / size.x);

View File

@ -208,10 +208,8 @@ void main() {
glyph_offset_calc.y = cell_size_scaled.y - glyph_offset_calc.y; glyph_offset_calc.y = cell_size_scaled.y - glyph_offset_calc.y;
// If this is a constrained mode, we need to constrain it! // If this is a constrained mode, we need to constrain it!
// We also always constrain colored glyphs since we should have
// their scaled cell size exactly correct.
vec2 glyph_size_calc = glyph_size; vec2 glyph_size_calc = glyph_size;
if (mode == MODE_FG_CONSTRAINED || mode == MODE_FG_COLOR) { if (mode == MODE_FG_CONSTRAINED) {
if (glyph_size.x > cell_size_scaled.x) { if (glyph_size.x > cell_size_scaled.x) {
float new_y = glyph_size.y * (cell_size_scaled.x / glyph_size.x); float new_y = glyph_size.y * (cell_size_scaled.x / glyph_size.x);
glyph_offset_calc.y = glyph_offset_calc.y + ((glyph_size.y - new_y) / 2); glyph_offset_calc.y = glyph_offset_calc.y + ((glyph_size.y - new_y) / 2);