@@ -27,8 +27,8 @@ ArduinoGraphics::ArduinoGraphics(int width, int height) :
2727 _width(width),
2828 _height(height),
2929 _font(NULL ),
30- _textsize_x (1 ),
31- _textsize_y (1 )
30+ _textSizeX (1 ),
31+ _textSizeY (1 )
3232{
3333}
3434
@@ -243,7 +243,7 @@ void ArduinoGraphics::text(const char* str, int x, int y)
243243 uint8_t const c = (uint8_t )*str++;
244244
245245 if (c == ' \n ' ) {
246- y += _font->height * _textsize_y ;
246+ y += _font->height * _textSizeY ;
247247 } else if (c == ' \r ' ) {
248248 x = 0 ;
249249 } else if (c == 0xc2 || c == 0xc3 ) {
@@ -256,10 +256,10 @@ void ArduinoGraphics::text(const char* str, int x, int y)
256256 }
257257
258258 if (b) {
259- scaledBitmap (b, x, y, _font->width , _font->height , _textsize_x, _textsize_y );
259+ bitmap (b, x, y, _font->width , _font->height , _textSizeX, _textSizeY );
260260 }
261261
262- x += _font->width * _textsize_x ;
262+ x += _font->width * _textSizeX ;
263263 }
264264 }
265265}
@@ -271,28 +271,22 @@ void ArduinoGraphics::textFont(const Font& which)
271271
272272int ArduinoGraphics::textFontWidth () const
273273{
274- return (_font ? _font->width * _textsize_x : 0 );
274+ return (_font ? _font->width * _textSizeX : 0 );
275275}
276276
277277int ArduinoGraphics::textFontHeight () const
278278{
279- return (_font ? _font->height * _textsize_y : 0 );
279+ return (_font ? _font->height * _textSizeY : 0 );
280280}
281281
282- void ArduinoGraphics::setTextSize (uint8_t sx, uint8_t sy)
282+ void ArduinoGraphics::textSize (uint8_t sx, uint8_t sy)
283283{
284- _textsize_x = (sx > 0 )? sx : 1 ;
285- _textsize_y = (sy > 0 )? sy : 1 ;
284+ _textSizeX = (sx > 0 )? sx : 1 ;
285+ _textSizeY = (sy > 0 )? sy : 1 ;
286286}
287287
288288
289- void ArduinoGraphics::bitmap (const uint8_t * data, int x, int y, int width, int height)
290- {
291- // forward to scaled version
292- scaledBitmap (data, x, y, width, height, 1 , 1 );
293- }
294-
295- void ArduinoGraphics::scaledBitmap (const uint8_t * data, int x, int y, int w, int h, uint8_t scale_x, uint8_t scale_y) {
289+ void ArduinoGraphics::bitmap (const uint8_t * data, int x, int y, int w, int h, uint8_t scale_x, uint8_t scale_y) {
296290 if (!_stroke || !scale_x || !scale_y) {
297291 return ;
298292 }
@@ -380,7 +374,7 @@ void ArduinoGraphics::image(const Image& img, int x, int y)
380374
381375void ArduinoGraphics::image (const Image& img, int x, int y, int width, int height)
382376{
383- if (!img || ((x + width) < 0 ) || ((y + height) < 0 ) || (x > _width) || (y > height )) {
377+ if (!img || ((x + width) < 0 ) || ((y + height) < 0 ) || (x > _width) || (y > _height )) {
384378 // offscreen
385379 return ;
386380 }
@@ -459,7 +453,7 @@ void ArduinoGraphics::endText(int scrollDirection)
459453 beginDraw ();
460454 int const text_x = _textX - i;
461455 text (_textBuffer, text_x, _textY);
462- scaledBitmap (_font->data [0x20 ], text_x - 1 , _textY, 1 , _font->height , _textsize_x, _textsize_y );
456+ bitmap (_font->data [0x20 ], text_x - 1 , _textY, 1 , _font->height , _textSizeX, _textSizeY );
463457 endDraw ();
464458
465459 delay (_textScrollSpeed);
@@ -471,7 +465,7 @@ void ArduinoGraphics::endText(int scrollDirection)
471465 beginDraw ();
472466 int const text_x = _textX - (scrollLength - i - 1 );
473467 text (_textBuffer, text_x, _textY);
474- scaledBitmap (_font->data [0x20 ], text_x - 1 , _textY, 1 , _font->height , _textsize_x, _textsize_y );
468+ bitmap (_font->data [0x20 ], text_x - 1 , _textY, 1 , _font->height , _textSizeX, _textSizeY );
475469 endDraw ();
476470
477471 delay (_textScrollSpeed);
@@ -483,7 +477,7 @@ void ArduinoGraphics::endText(int scrollDirection)
483477 beginDraw ();
484478 int const text_y = _textY - i;
485479 text (_textBuffer, _textX, text_y);
486- scaledBitmap (_font->data [0x20 ], _textX, text_y - 1 , _font->width , 1 , _textsize_x, _textsize_y );
480+ bitmap (_font->data [0x20 ], _textX, text_y - 1 , _font->width , 1 , _textSizeX, _textSizeY );
487481 endDraw ();
488482
489483 delay (_textScrollSpeed);
@@ -495,7 +489,7 @@ void ArduinoGraphics::endText(int scrollDirection)
495489 beginDraw ();
496490 int const text_y = _textY - (scrollLength - i - 1 );
497491 text (_textBuffer, _textX, text_y);
498- scaledBitmap (_font->data [0x20 ], _textX, text_y - 1 , _font->width , 1 , _textsize_x, _textsize_y );
492+ bitmap (_font->data [0x20 ], _textX, text_y - 1 , _font->width , 1 , _textSizeX, _textSizeY );
499493 endDraw ();
500494
501495 delay (_textScrollSpeed);
0 commit comments