summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-10-22 12:05:38 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-10-22 12:05:38 (GMT)
commit278f35823b8f927483a251737dc907975c99675c (patch)
tree401938269996cb15b98e18c029ef67012d80a5ee /gui
parent7fcc2dd58e4df3cf4d52f451371d7d550a155b01 (diff)
downloadeeshow-278f35823b8f927483a251737dc907975c99675c.zip
eeshow-278f35823b8f927483a251737dc907975c99675c.tar.gz
eeshow-278f35823b8f927483a251737dc907975c99675c.tar.bz2
gui/pop.c (place_pop_cover), pop.h: place pop-up to cover bounding box
Diffstat (limited to 'gui')
-rw-r--r--gui/pop.c20
-rw-r--r--gui/pop.h2
2 files changed, 22 insertions, 0 deletions
diff --git a/gui/pop.c b/gui/pop.c
index 10f319f..d686af5 100644
--- a/gui/pop.c
+++ b/gui/pop.c
@@ -186,3 +186,23 @@ void place_pop(struct gui *gui, const struct dwg_bbox *bbox)
}
}
+
+
+void place_pop_cover(struct gui *gui, const struct dwg_bbox *bbox,
+ struct overlay_style *style)
+{
+ const struct gui_sheet *curr_sheet = gui->curr_sheet;
+ int sx, sy, ex, ey;
+
+ eeschema_coord(gui,
+ bbox->x - curr_sheet->xmin, bbox->y - curr_sheet->ymin,
+ &sx, &sy);
+ eeschema_coord(gui, bbox->x + bbox->w - curr_sheet->xmin,
+ bbox->y + bbox->h - curr_sheet->ymin, &ex, &ey);
+
+ gui->pop_x = sx - style->pad;
+ gui->pop_y = sy - style->pad;
+ style->wmin = style->wmax = ex - sx + 1;
+ style->hmin = style->hmax = ey - sy + 1;
+ gui->pop_dx = gui->pop_dy = 0;
+}
diff --git a/gui/pop.h b/gui/pop.h
index d4a0c0a..21c6343 100644
--- a/gui/pop.h
+++ b/gui/pop.h
@@ -24,5 +24,7 @@ void add_pop_item(struct gui *gui, void (*click)(void *user), void *user,
unsigned width, bool dim, const char *fmt, ...);
void add_pop_frame(struct gui *gui);
void place_pop(struct gui *gui, const struct dwg_bbox *bbox);
+void place_pop_cover(struct gui *gui, const struct dwg_bbox *bbox,
+ struct overlay_style *style);
#endif /* !GUI_POP_H */