@@ -27,8 +27,8 @@ ArduinoGraphics::ArduinoGraphics(int width, int height) :
27
27
_width(width),
28
28
_height(height),
29
29
_font(NULL ),
30
- _textsize_x (1 ),
31
- _textsize_y (1 )
30
+ _textSizeX (1 ),
31
+ _textSizeY (1 )
32
32
{
33
33
}
34
34
@@ -243,7 +243,7 @@ void ArduinoGraphics::text(const char* str, int x, int y)
243
243
uint8_t const c = (uint8_t )*str++;
244
244
245
245
if (c == ' \n ' ) {
246
- y += _font->height * _textsize_y ;
246
+ y += _font->height * _textSizeY ;
247
247
} else if (c == ' \r ' ) {
248
248
x = 0 ;
249
249
} else if (c == 0xc2 || c == 0xc3 ) {
@@ -256,10 +256,10 @@ void ArduinoGraphics::text(const char* str, int x, int y)
256
256
}
257
257
258
258
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 );
260
260
}
261
261
262
- x += _font->width * _textsize_x ;
262
+ x += _font->width * _textSizeX ;
263
263
}
264
264
}
265
265
}
@@ -271,28 +271,22 @@ void ArduinoGraphics::textFont(const Font& which)
271
271
272
272
int ArduinoGraphics::textFontWidth () const
273
273
{
274
- return (_font ? _font->width * _textsize_x : 0 );
274
+ return (_font ? _font->width * _textSizeX : 0 );
275
275
}
276
276
277
277
int ArduinoGraphics::textFontHeight () const
278
278
{
279
- return (_font ? _font->height * _textsize_y : 0 );
279
+ return (_font ? _font->height * _textSizeY : 0 );
280
280
}
281
281
282
- void ArduinoGraphics::setTextSize (uint8_t sx, uint8_t sy)
282
+ void ArduinoGraphics::textSize (uint8_t sx, uint8_t sy)
283
283
{
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 ;
286
286
}
287
287
288
288
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) {
296
290
if (!_stroke || !scale_x || !scale_y) {
297
291
return ;
298
292
}
@@ -380,7 +374,7 @@ void ArduinoGraphics::image(const Image& img, int x, int y)
380
374
381
375
void ArduinoGraphics::image (const Image& img, int x, int y, int width, int height)
382
376
{
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 )) {
384
378
// offscreen
385
379
return ;
386
380
}
@@ -459,7 +453,7 @@ void ArduinoGraphics::endText(int scrollDirection)
459
453
beginDraw ();
460
454
int const text_x = _textX - i;
461
455
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 );
463
457
endDraw ();
464
458
465
459
delay (_textScrollSpeed);
@@ -471,7 +465,7 @@ void ArduinoGraphics::endText(int scrollDirection)
471
465
beginDraw ();
472
466
int const text_x = _textX - (scrollLength - i - 1 );
473
467
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 );
475
469
endDraw ();
476
470
477
471
delay (_textScrollSpeed);
@@ -483,7 +477,7 @@ void ArduinoGraphics::endText(int scrollDirection)
483
477
beginDraw ();
484
478
int const text_y = _textY - i;
485
479
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 );
487
481
endDraw ();
488
482
489
483
delay (_textScrollSpeed);
@@ -495,7 +489,7 @@ void ArduinoGraphics::endText(int scrollDirection)
495
489
beginDraw ();
496
490
int const text_y = _textY - (scrollLength - i - 1 );
497
491
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 );
499
493
endDraw ();
500
494
501
495
delay (_textScrollSpeed);
0 commit comments