void u8g_DrawRFrame(u8g_t *u8g, u8g_uint_t x, u8g_uint_t y, u8g_uint_t w, u8g_uint_t h, u8g_uint_t r) { u8g_uint_t xl, yu; if ( u8g_IsBBXIntersection(u8g, x, y, w, h) == 0 ) return; xl = x; xl += r; yu = y; yu += r; { u8g_uint_t yl, xr; xr = x; xr += w; xr -= r; xr -= 1; yl = y; yl += h; yl -= r; yl -= 1; u8g_draw_circle(u8g, xl, yu, r, U8G_DRAW_UPPER_LEFT); u8g_draw_circle(u8g, xr, yu, r, U8G_DRAW_UPPER_RIGHT); u8g_draw_circle(u8g, xl, yl, r, U8G_DRAW_LOWER_LEFT); u8g_draw_circle(u8g, xr, yl, r, U8G_DRAW_LOWER_RIGHT); } { u8g_uint_t ww, hh; ww = w; ww -= r; ww -= r; ww -= 2; hh = h; hh -= r; hh -= r; hh -= 2; xl++; yu++; h--; w--; u8g_draw_hline(u8g, xl, y, ww); u8g_draw_hline(u8g, xl, y+h, ww); u8g_draw_vline(u8g, x, yu, hh); u8g_draw_vline(u8g, x+w, yu, hh); } }
/* restrictions: w > 0 && h > 0 */ void u8g_DrawFrame(u8g_t *u8g, u8g_uint_t x, u8g_uint_t y, u8g_uint_t w, u8g_uint_t h) { u8g_uint_t xtmp = x; if ( u8g_IsBBXIntersection(u8g, x, y, w, h) == 0 ) return; u8g_draw_hline(u8g, x, y, w); u8g_draw_vline(u8g, x, y, h); x+=w; x--; u8g_draw_vline(u8g, x, y, h); y+=h; y--; u8g_draw_hline(u8g, xtmp, y, w); }
void u8g_DrawVLine(u8g_t *u8g, u8g_uint_t x, u8g_uint_t y, u8g_uint_t w) { if ( u8g_IsBBXIntersection(u8g, x, y, 1, w) == 0 ) return; u8g_draw_vline(u8g, x, y, w); }
void u8g_DrawVLine(u8g_t *u8g, u8g_uint_t x, u8g_uint_t y, u8g_uint_t w) { u8g_draw_vline(u8g, x, y, w); }