mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2025-04-21 12:27:27 +03:00
eeshow/gui.c (redraw): abstract gtk_widget_queue_draw()
This commit is contained in:
17
eeshow/gui.c
17
eeshow/gui.c
@@ -75,6 +75,15 @@ struct gui_ctx {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* ----- Helper functions -------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
static void redraw(const struct gui_ctx *ctx)
|
||||||
|
{
|
||||||
|
gtk_widget_queue_draw(ctx->da);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ----- Area of intereest ------------------------------------------------- */
|
/* ----- Area of intereest ------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
@@ -210,7 +219,7 @@ static void pan_update(struct gui_ctx *ctx, int x, int y)
|
|||||||
ctx->pan_x = x;
|
ctx->pan_x = x;
|
||||||
ctx->pan_y = y;
|
ctx->pan_y = y;
|
||||||
|
|
||||||
gtk_widget_queue_draw(ctx->da);
|
redraw(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -232,7 +241,7 @@ static void zoom_in(struct gui_ctx *ctx, int x, int y)
|
|||||||
ctx->zoom--;
|
ctx->zoom--;
|
||||||
ctx->x = (ctx->x + x) / 2;
|
ctx->x = (ctx->x + x) / 2;
|
||||||
ctx->y = (ctx->y + y) / 2;
|
ctx->y = (ctx->y + y) / 2;
|
||||||
gtk_widget_queue_draw(ctx->da);
|
redraw(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -243,7 +252,7 @@ static void zoom_out(struct gui_ctx *ctx, int x, int y)
|
|||||||
ctx->zoom++;
|
ctx->zoom++;
|
||||||
ctx->x = 2 * ctx->x - x;
|
ctx->x = 2 * ctx->x - x;
|
||||||
ctx->y = 2 * ctx->y - y;
|
ctx->y = 2 * ctx->y - y;
|
||||||
gtk_widget_queue_draw(ctx->da);
|
redraw(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -261,7 +270,7 @@ static void zoom_to_extents(struct gui_ctx *ctx)
|
|||||||
sheet->h >> ctx->zoom > alloc.height)
|
sheet->h >> ctx->zoom > alloc.height)
|
||||||
ctx->zoom++;
|
ctx->zoom++;
|
||||||
|
|
||||||
gtk_widget_queue_draw(ctx->da);
|
redraw(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user