Skip to content

Commit 675c972

Browse files
committed
Added a cast to int_16 since height and width are uint_16s.
Note: Consider harmonizing types since uints might spill if someone invents a 64k wide or high oled.. Jk. Changing h and w might be nice tho, but keeping changes at minimum here.
1 parent 1e6251e commit 675c972

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Adafruit_GFX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,8 +1588,8 @@ void Adafruit_GFX_Button::drawButton(boolean inverted) {
15881588
*/
15891589
/**************************************************************************/
15901590
boolean Adafruit_GFX_Button::contains(int16_t x, int16_t y) {
1591-
return ((x >= _x1) && (x < (_x1 + _w)) &&
1592-
(y >= _y1) && (y < (_y1 + _h)));
1591+
return ((x >= _x1) && (x < (int16_t) (_x1 + _w)) &&
1592+
(y >= _y1) && (y < (int16_t) (_y1 + _h)));
15931593
}
15941594

15951595
/**************************************************************************/

0 commit comments

Comments
 (0)