-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdraw_funcs.c
32 lines (26 loc) · 1.35 KB
/
draw_funcs.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <hb.h>
extern void drawMoveTo(void *draw_data, float to_x, float to_y);
extern void drawLineTo(void *draw_data, float to_x, float to_y);
extern void drawQuadraticTo(void *draw_data, float control_x, float control_y, float to_x, float to_y);
extern void drawCubicTo(void *draw_data, float control1_x, float control1_y, float control2_x, float control2_y, float to_x, float to_y);
extern void drawClosePath(void *draw_data);
void move_to(hb_draw_funcs_t *dfuncs, void *draw_data, hb_draw_state_t *st, float to_x, float to_y, void *user_data)
{
drawMoveTo(draw_data, to_x, to_y);
}
void line_to(hb_draw_funcs_t *dfuncs, void *draw_data, hb_draw_state_t *st, float to_x, float to_y, void *user_data)
{
drawLineTo(draw_data, to_x, to_y);
}
void quadratic_to(hb_draw_funcs_t *dfuncs, void *draw_data, hb_draw_state_t *st, float control_x, float control_y, float to_x, float to_y, void *user_data)
{
drawQuadraticTo(draw_data, control_x, control_y, to_x, to_y);
}
void cubic_to(hb_draw_funcs_t *dfuncs, void *draw_data, hb_draw_state_t *st, float control1_x, float control1_y, float control2_x, float control2_y, float to_x, float to_y, void *user_data)
{
drawCubicTo(draw_data, control1_x, control1_y, control2_x, control2_y, to_x, to_y);
}
void close_path(hb_draw_funcs_t *dfuncs, void *draw_data, hb_draw_state_t *st, void *user_data)
{
drawClosePath(draw_data);
}