ticks: don't draw final layout if there isn't space

This just helps keep things from geting cut off.
This commit is contained in:
Christian Hergert
2019-08-01 00:26:02 -07:00
parent 2d69a5ff1c
commit 2d6906b542

View File

@ -198,7 +198,9 @@ draw_ticks (SysprofVisualizerTicks *self,
cairo_move_to (cr, (gint)x + 2.5 - (gint)half, 2);
update_label_text (layout, t - begin_time, want_msec);
pango_layout_get_pixel_size (layout, &w, &h);
pango_cairo_show_layout (cr, layout);
if (x + w <= alloc.width)
pango_cairo_show_layout (cr, layout);
last_x2 = x + w;
}