Cairo rendering position slightly off with GTK 4
It's just slightly off, at least vertically. I don't know VTE internals well enough to know if there is something else the matter, only the slight change that makes it render where I can see the whole glyph/tofu boundary.
Before
After
diff --git a/src/widget.cc b/src/widget.cc
index ec69f628..23080182 100644
--- a/src/widget.cc
+++ b/src/widget.cc
@@ -1917,6 +1917,7 @@ Widget::snapshot(GtkSnapshot* snapshot_object)
auto region = vte::take_freeable(cairo_region_create_rectangle(rect));
auto grect = vte::graphene::make_rect(rect);
auto cr = vte::take_freeable(gtk_snapshot_append_cairo(snapshot_object, &grect));
+ cairo_translate(cr.get(), 0, 1);
terminal()->draw(cr.get(), region.get());
}
Edited by Andre Klapper