billgod / u8glib

Automatically exported from code.google.com/p/u8glib
Other
0 stars 0 forks source link

Dotted/dashed line (patch) #338

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi all,

I find u8lib a great tool (use arduino + pcd8544 nokia display), but one 
feature, important for me, is missing. Normal lines (x1,y1,x2,y2) are drawn 
solid. I needed drawing dotted and dashed lines. I took a look into the code 
and added this:

void U8GLIB::u8g_DrawDLine(u8g_t *u8g, u8g_uint_t x1, u8g_uint_t y1, u8g_uint_t 
x2, u8g_uint_t y2, u8g_int_t d);

Idea is simple: d parameters describes how many points in the line are 
plotted/missed. So if "d" equals:
0 - ordinary solid line
1 - dotted line (odd points are printed)
2+ - dashed line ("d" points drawn then "d" points omitted)
-d - dash size is the same as for "d", but "invisible" pointsare first

Is is not a big contribution but I hope someone will find it useful. The file 
attached is a patch against v1.17 (arduino lib). 

Original issue reported on code.google.com by manieq....@gmail.com on 28 Apr 2015 at 10:12

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the contribution

Original comment by olikr...@gmail.com on 1 May 2015 at 7:13