1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-12-23 09:47:22 +02:00

eeshow/: work around the ink_rect.y bug more elegantly

Still have no clue what causes this.
This commit is contained in:
Werner Almesberger 2016-08-06 23:01:51 -03:00
parent 51f6852bf9
commit cb4ee6d5b9
2 changed files with 14 additions and 9 deletions

View File

@ -154,7 +154,19 @@ fprintf(stderr, "%d + %d %d + %d\n",
#if 0
fprintf(stderr, "%u(%d) %u %.60s\n", ty, ink_rect.y / PANGO_SCALE, ink_h, over->s);
#endif
cairo_rectangle(cr, tx, ty, ink_w, ink_h);
/*
* @@@ for some mysterious reason, we get
* ink_h = ink_rect.height / PANGO_SCALE = 5
* instead of 2 if using overlay_style_dense_selected. Strangely, changing
* overlay_style_dense_selected such that it becomes more like
* overlay_style_dense has no effect.
*
* This causes the text to be cut vertically, roughly in the middle. We hack
* around this problem by growind the clipping area vertically. This works,
* since we're currently only concerned about horizontal clipping anyway.
*/
cairo_rectangle(cr, tx, ty, ink_w, ink_h + 20);
cairo_clip(cr);
}

View File

@ -323,19 +323,12 @@ static void show_history(struct gui_ctx *ctx)
overlay_remove_all(&ctx->vcs_overlays);
for (h = ctx->hist; h; h = h->next) {
// @@@ \n doesn't work with cairo_show_text :-(
over = overlay_add(&ctx->vcs_overlays, &ctx->aois,
NULL, click_history, h);
overlay_text(over, "<small>%s</small>",
vcs_git_summary(h->hist));
overlay_style(over,
/*
* @@@ for some mysterious reason, we get ink_rect.height / PANGO_SCALE = 5
* instead of 2 if using overlay_style_dense_selected. Strangely, changing
* overlay_style_dense_selected such that it becomes more like
* overlay_style_dense has no effect.
*/
h == ctx->curr_hist ? &overlay_style_dense_selected :
h == ctx->curr_hist ? &style_dense_selected :
&style_dense);
}
redraw(ctx);