fix fit mode when image is rotated
This commit is contained in:
parent
3a2929e6d4
commit
b28217b209
|
@ -299,6 +299,8 @@ entice_image_rotate(Evas_Object *obj, unsigned int rot)
|
||||||
|
|
||||||
orient = evas_object_image_orient_get(sd->img) + rot;
|
orient = evas_object_image_orient_get(sd->img) + rot;
|
||||||
evas_object_image_orient_set(sd->img, orient & 3);
|
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
|
Entice_Zoom_Mode
|
||||||
|
@ -364,13 +366,16 @@ entice_image_zoom_fit(Evas_Object *obj)
|
||||||
Evas_Coord ih;
|
Evas_Coord ih;
|
||||||
Evas_Coord x;
|
Evas_Coord x;
|
||||||
Evas_Coord y;
|
Evas_Coord y;
|
||||||
|
Evas_Image_Orient orient;
|
||||||
|
|
||||||
sd = evas_object_smart_data_get(obj);
|
sd = evas_object_smart_data_get(obj);
|
||||||
EINA_SAFETY_ON_NULL_RETURN(sd);
|
EINA_SAFETY_ON_NULL_RETURN(sd);
|
||||||
|
|
||||||
win = evas_object_data_get(obj, "win");
|
win = evas_object_data_get(obj, "win");
|
||||||
evas_object_geometry_get(win, NULL, NULL, &w, &h);
|
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);
|
evas_object_image_size_get(sd->img, &iw, &ih);
|
||||||
|
|
||||||
if ((w * ih) > (iw * h))
|
if ((w * ih) > (iw * h))
|
||||||
{
|
{
|
||||||
int tmp = ih;
|
int tmp = ih;
|
||||||
|
|
|
@ -33,21 +33,6 @@ typedef enum
|
||||||
ENTICE_ZOOM_MODE_FIT
|
ENTICE_ZOOM_MODE_FIT
|
||||||
} Entice_Zoom_Mode;
|
} 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);
|
Evas_Object *entice_image_add(Evas_Object *win);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue