From b7ce408f65b92b080337b3670da54e3c3aab79c5 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Mon, 7 Dec 2020 02:09:06 -0500 Subject: [PATCH] puzzles: update frontend for new midend_get_cursor_location semantics midend_get_cursor_location now returns a bool indicating success. Change-Id: Ie3e7130a821b6619c829846177baf2cc6b51e3a3 --- apps/plugins/puzzles/rockbox.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c index 08581db1c6..73f9857b4a 100644 --- a/apps/plugins/puzzles/rockbox.c +++ b/apps/plugins/puzzles/rockbox.c @@ -1566,8 +1566,7 @@ static void rb_end_draw(void *handle) { rb->lcd_set_foreground(LCD_RGBPACK(255,0,255)); int x, y, w, h; - midend_get_cursor_location(me, &x, &y, &w, &h); - if(x >= 0) + if(midend_get_cursor_location(me, &x, &y, &w, &h)) rb->lcd_drawrect(x, y, w, h); } @@ -2230,10 +2229,7 @@ static void zoom_center_on_cursor(void) { /* get cursor bounding rectangle */ int x, y, w, h; - midend_get_cursor_location(me, &x, &y, &w, &h); - - /* no cursor */ - if(x < 0) + if(!midend_get_cursor_location(me, &x, &y, &w, &h)) return; /* check if either of the top-left and bottom-right corners are