olikraus / u8glib

Arduino Monochrom Graphics Library for LCDs and OLEDs
https://github.com/olikraus/u8glib/wiki
Other
1.25k stars 314 forks source link

make pbm screen sizes less hardcoded #424

Closed matthijskooijman closed 8 years ago

matthijskooijman commented 8 years ago

The .c files for the pbm bitmap-writing virtual devices contain constants for the output width and height. Previously these constants were used throughout the code, making it impossible to change the width and height without changing these constants.

With this change, only the initialization uses the constants, but the rest of the code reads back the width and height from the device struct and uses those. This enables a user of these devices to change the width and height to change the size of the output.

This was tested for all three of the pbm devices.