Use unsigned for area size

Removed_REF_marker
DiSlord 5 years ago
parent cbdb99aa79
commit a15c0b43ef

@ -459,8 +459,8 @@ extern uint16_t graph_bottom;
// Num Input height at bottom
#define NUM_INPUT_HEIGHT 32
extern int16_t area_width;
extern int16_t area_height;
extern uint16_t area_width;
extern uint16_t area_height;
// Define marker size (can be 0 or 1)
#ifdef TINYSA3

@ -46,8 +46,8 @@ static int16_t grid_offset;
static int16_t grid_width;
static freq_t grid_span;
int16_t area_width = AREA_WIDTH_NORMAL;
int16_t area_height; // initialized in main() = AREA_HEIGHT_NORMAL;
uint16_t area_width = AREA_WIDTH_NORMAL;
uint16_t area_height; // initialized in main() = AREA_HEIGHT_NORMAL;
// Cell render use spi buffer
typedef uint16_t pixel_t;
@ -1532,9 +1532,9 @@ draw_cell(int m, int n)
int t;
uint16_t c;
// Clip cell by area
if (x0 + w > area_width)
if (w > area_width - x0)
w = area_width - x0;
if (y0 + h > area_height)
if (h > area_height - y0)
h = area_height - y0;
if (w <= 0 || h <= 0)
return;

Loading…
Cancel
Save

Powered by TurnKey Linux.