summaryrefslogtreecommitdiff
path: root/gui/glabel.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-18 04:01:45 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-18 04:01:45 -0300
commit1f7cfdea269bc41064dfa8e16c736e50b4037280 (patch)
treea46857757b800f749b8536cd72eab41660e0784c /gui/glabel.c
parent9820d6599b1834b665c8fac3098fbb9692ba81a7 (diff)
downloadeeshow-1f7cfdea269bc41064dfa8e16c736e50b4037280.tar.gz
eeshow-1f7cfdea269bc41064dfa8e16c736e50b4037280.tar.bz2
eeshow-1f7cfdea269bc41064dfa8e16c736e50b4037280.zip
eeshow/gui/gui.c (eeschema_coord): only used in glabel.c, move there
Diffstat (limited to 'gui/glabel.c')
-rw-r--r--gui/glabel.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gui/glabel.c b/gui/glabel.c
index d99137b..4dc37d2 100644
--- a/gui/glabel.c
+++ b/gui/glabel.c
@@ -36,6 +36,23 @@ struct glabel_aoi_ctx {
};
+/* ----- Tools ------------------------------------------------------------- */
+
+
+static void eeschema_coord(const struct gui_ctx *ctx,
+ int x, int y, int *rx, int *ry)
+{
+ GtkAllocation alloc;
+
+ gtk_widget_get_allocation(ctx->da, &alloc);
+ *rx = ((x - ctx->x) >> ctx->zoom) + alloc.width / 2;
+ *ry = ((y - ctx->y) >> ctx->zoom) + alloc.height / 2;
+}
+
+
+/* ----- AoIs -------------------------------------------------------------- */
+
+
static void glabel_dest_click(void *user)
{
struct gui_sheet *sheet = user;