1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-09-30 00:35:05 +03:00

eeshow/gui/gui.c (eeschema_coord): only used in glabel.c, move there

This commit is contained in:
Werner Almesberger 2016-08-18 04:01:45 -03:00
parent 23fed29423
commit 9792a22799
3 changed files with 17 additions and 14 deletions

View File

@ -129,7 +129,6 @@ void show_history(struct gui_ctx *ctx, enum selecting sel);
/* gui.c */
void redraw(const struct gui_ctx *ctx);
void eeschema_coord(const struct gui_ctx *ctx, int x, int y, int *rx, int *ry);
struct gui_sheet *find_corresponding_sheet(struct gui_sheet *pick_from,
struct gui_sheet *ref_in, const struct gui_sheet *ref);
void render_sheet(struct gui_sheet *sheet);

View File

@ -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;

View File

@ -196,19 +196,6 @@ void render_delta(struct gui_ctx *ctx)
}
/* ----- Tools ------------------------------------------------------------- */
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;
}
/* ----- AoI callbacks ----------------------------------------------------- */