Skip to content

Commit

Permalink
additional checks for u8g_line.c
Browse files Browse the repository at this point in the history
  • Loading branch information
olikraus committed Jun 2, 2015
1 parent 4349510 commit eedf07d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion csrc/u8g_line.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
u8g_line.h
u8g_line.c
Universal 8bit Graphics Library
Expand Down Expand Up @@ -65,6 +65,15 @@ void u8g_DrawLine(u8g_t *u8g, u8g_uint_t x1, u8g_uint_t y1, u8g_uint_t x2, u8g_u
err = dx >> 1;
if ( y2 > y1 ) ystep = 1; else ystep = -1;
y = y1;

#ifndef U8G_16BIT
if ( x2 == 255 )
x2--;
#else
if ( x2 == 0xffff )
x2--;
#endif

for( x = x1; x <= x2; x++ )
{
if ( swapxy == 0 )
Expand Down

0 comments on commit eedf07d

Please sign in to comment.