hvline callback

This commit is contained in:
olikraus 2016-02-17 22:12:19 +01:00
parent 0fb099125e
commit 6ca5dacaa9
3 changed files with 8 additions and 2 deletions

View File

@ -154,6 +154,7 @@ typedef struct u8g2_cb_struct u8g2_cb_t;
typedef void (*u8g2_update_dimension_cb)(u8g2_t *u8g2);
typedef void (*u8g2_draw_l90_cb)(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t len, uint8_t dir);
typedef void (*u8g2_draw_ll_hvline_cb)(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t len, uint8_t dir);
@ -230,6 +231,7 @@ typedef u8g2_uint_t (*u8g2_font_calc_vref_fnptr)(u8g2_t *u8g2);
struct u8g2_struct
{
u8x8_t u8x8;
u8g2_draw_ll_hvline_cb ll_hvline; /* low level hvline procedure */
const u8g2_cb_t *cb; /* callback drawprocedures, can be replaced for rotation */
/* the following variables must be assigned during u8g2 setup */

View File

@ -146,7 +146,8 @@ static void u8g2_draw_hv_line_2dir(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u
len -= y;
}
u8g2_draw_low_level_hv_line(u8g2, x, y, len, dir);
u8g2->ll_hvline(u8g2, x, y, len, dir);
//u8g2_draw_low_level_hv_line(u8g2, x, y, len, dir);
}
#endif
@ -182,7 +183,8 @@ void u8g2_draw_hv_line_4dir(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uin
#ifdef U8G2_WITH_CLIPPING
u8g2_draw_hv_line_2dir(u8g2, x, y, len, dir);
#else
u8g2_draw_low_level_hv_line(u8g2, x, y, len, dir);
u8g2->ll_hvline(u8g2, x, y, len, dir);
//u8g2_draw_low_level_hv_line(u8g2, x, y, len, dir);
#endif
}

View File

@ -40,6 +40,8 @@
void u8g2_SetupBuffer(u8g2_t *u8g2, uint8_t *buf, uint8_t tile_buf_height, const u8g2_cb_t *u8g2_cb)
{
u8g2->ll_hvline = u8g2_draw_low_level_hv_line;
u8g2->tile_buf_ptr = buf;
u8g2->tile_buf_height = tile_buf_height;