fix fit mode when image is rotated

This commit is contained in:
Vincent Torri 2021-03-16 13:42:06 +01:00
parent 3a2929e6d4
commit b28217b209
2 changed files with 5 additions and 15 deletions

View File

@ -299,6 +299,8 @@ entice_image_rotate(Evas_Object *obj, unsigned int rot)
orient = evas_object_image_orient_get(sd->img) + rot;
evas_object_image_orient_set(sd->img, orient & 3);
if (sd->zoom_mode == ENTICE_ZOOM_MODE_FIT)
entice_image_zoom_fit(obj);
}
Entice_Zoom_Mode
@ -364,13 +366,16 @@ entice_image_zoom_fit(Evas_Object *obj)
Evas_Coord ih;
Evas_Coord x;
Evas_Coord y;
Evas_Image_Orient orient;
sd = evas_object_smart_data_get(obj);
EINA_SAFETY_ON_NULL_RETURN(sd);
win = evas_object_data_get(obj, "win");
evas_object_geometry_get(win, NULL, NULL, &w, &h);
orient = evas_object_image_orient_get(sd->img);
evas_object_image_size_get(sd->img, &iw, &ih);
if ((w * ih) > (iw * h))
{
int tmp = ih;

View File

@ -33,21 +33,6 @@ typedef enum
ENTICE_ZOOM_MODE_FIT
} Entice_Zoom_Mode;
#if 0
typedef struct
{
const char *filename;
Evas_Image_Orient orient;
Entice_Zoom_Mode zoom_mode;
int width;
int height;
} Entice_Image_Prop;
void entice_image_current_set(Evas_Object *win, Eina_List *image);
void entice_image_current_zoom(Evas_Object *win, double zoom);
#endif
Evas_Object *entice_image_add(Evas_Object *win);