mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
renderer: for constrained cells, offset was being doubled
This helps better preserve the centerline for constrained glyphs
This commit is contained in:
@ -165,7 +165,7 @@ vertex VertexOut uber_vertex(
|
|||||||
if (input.mode == MODE_FG_CONSTRAINED) {
|
if (input.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.y += glyph_size.y - new_y;
|
glyph_offset.y += (glyph_size.y - new_y) / 2;
|
||||||
glyph_size.y = new_y;
|
glyph_size.y = new_y;
|
||||||
glyph_size.x = cell_size_scaled.x;
|
glyph_size.x = cell_size_scaled.x;
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ void main() {
|
|||||||
if (mode == MODE_FG_CONSTRAINED) {
|
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);
|
glyph_offset_calc.y = glyph_offset_calc.y + ((glyph_size.y - new_y) / 2);
|
||||||
glyph_size_calc.y = new_y;
|
glyph_size_calc.y = new_y;
|
||||||
glyph_size_calc.x = cell_size_scaled.x;
|
glyph_size_calc.x = cell_size_scaled.x;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user