mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-12-23 12:54:35 +02:00
eeshow/gui/over.c (overlay_draw): shift border outside the content area
This also ensures that lines with an odd-numbered width are not blended.
This commit is contained in:
parent
969356a0b8
commit
56a4479912
@ -55,7 +55,7 @@ struct overlay {
|
|||||||
/* ----- Drawing core ------------------------------------------------------ */
|
/* ----- Drawing core ------------------------------------------------------ */
|
||||||
|
|
||||||
|
|
||||||
static void rrect(cairo_t *cr, int x, int y, int w, int h, int r)
|
static void rrect(cairo_t *cr, double x, double y, double w, double h, int r)
|
||||||
{
|
{
|
||||||
const double deg = M_PI / 180.0;
|
const double deg = M_PI / 180.0;
|
||||||
|
|
||||||
@ -78,6 +78,7 @@ static unsigned overlay_draw(struct overlay *over, cairo_t *cr,
|
|||||||
unsigned ink_w, ink_h; /* effectively used text area size */
|
unsigned ink_w, ink_h; /* effectively used text area size */
|
||||||
unsigned w, h; /* box size */
|
unsigned w, h; /* box size */
|
||||||
int tx, ty; /* text start position */
|
int tx, ty; /* text start position */
|
||||||
|
double center;
|
||||||
|
|
||||||
PangoLayout *layout;
|
PangoLayout *layout;
|
||||||
PangoFontDescription *desc;
|
PangoFontDescription *desc;
|
||||||
@ -114,7 +115,9 @@ fprintf(stderr, "%d + %d %d + %d\n",
|
|||||||
tx = x - ink_rect.x / PANGO_SCALE + style->pad;
|
tx = x - ink_rect.x / PANGO_SCALE + style->pad;
|
||||||
ty = y - ink_rect.y / PANGO_SCALE + style->pad;
|
ty = y - ink_rect.y / PANGO_SCALE + style->pad;
|
||||||
|
|
||||||
rrect(cr, x, y, w, h, style->radius);
|
center = style->width / 2.0;
|
||||||
|
rrect(cr, x - center, y - center, w + style->width, h + style->width,
|
||||||
|
style->radius);
|
||||||
|
|
||||||
cairo_set_source_rgba(cr, bg->r, bg->g, bg->b, bg->alpha);
|
cairo_set_source_rgba(cr, bg->r, bg->g, bg->b, bg->alpha);
|
||||||
cairo_fill_preserve(cr);
|
cairo_fill_preserve(cr);
|
||||||
|
Loading…
Reference in New Issue
Block a user