mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +03:00
Merge pull request #1249 from mitchellh/constrain-dingbats
renderer: constrain dingbats unicode block to cell size
This commit is contained in:
@ -41,7 +41,9 @@ pub fn fgMode(
|
|||||||
// the subsequent character is empty, then we allow it to use
|
// the subsequent character is empty, then we allow it to use
|
||||||
// the full glyph size. See #1071.
|
// the full glyph size. See #1071.
|
||||||
.text => text: {
|
.text => text: {
|
||||||
if (!ziglyph.general_category.isPrivateUse(@intCast(cell.char))) {
|
if (!ziglyph.general_category.isPrivateUse(@intCast(cell.char)) and
|
||||||
|
!ziglyph.blocks.isDingbats(@intCast(cell.char)))
|
||||||
|
{
|
||||||
break :text .normal;
|
break :text .normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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