wjklimek1 / SSD1322_OLED_library

Portable library for 256x64 OLED display with SSD1322 controller (with STM32F4 example project)
Other
35 stars 8 forks source link

draw_hline overflow #1

Closed Flamy69 closed 3 years ago

Flamy69 commented 3 years ago

In draw_hline are 2 for cyclec over uint8_t, but if you draw line to pixel 255, cycle never end.

wjklimek1 commented 3 years ago

Oh, yes. I can see a problem. In the for loop I used uint8_t and i compared it to uint16_t, so it never gets true if value of uint16_t is bigger than max value of uint8_t. I will fix it soon.

Flamy69 commented 3 years ago

Same problem: draw_rect_filled. Maybe check all uint8_t, for vertical coordinates uint8_t is fine. For horizontal there has to be uint16_t.

wjklimek1 commented 3 years ago

I changed variables to uint16_t in following functions: draw_hline, draw_vline and draw_rect_filled. Now all operations should be available in entire bramebuffer range. If you find any other bugs, please let me know. I really appreaciate your effort to make library better.