when pressing 'n', window should not be resized beyond screen size

This commit is contained in:
Vincent Torri 2021-04-30 09:34:10 +02:00
parent 7e63809e79
commit da20d4a129
1 changed files with 8 additions and 0 deletions

View File

@ -131,8 +131,16 @@ void entice_key_handle(Evas_Object *win, Evas_Event_Key_Down *ev)
entice_image_size_get(entice->image, &w, &h);
if ((w > 1) && (h > 1))
{
int sw;
int sh;
entice_image_zoom_set(entice->image, 100);
entice_image_update(entice->image);
elm_win_screen_size_get(win, NULL, NULL, &sw, &sh);
if (w > sw)
w = sw;
if (h > sh)
h = sh;
evas_object_resize(win, w, h);
}
}