forked from enlightenment/efl
Emotion: prefer ratio to calculate sizes
Instead of calculate the ratio from the sizes, calc the width from the ratio, as ratio seems always accurate. Fallback to the old code if ratio not available (tbh I never see this case) @Fix EMOTION_ASPECT_KEEP_BOTH with some rare strams, mostly DVD and online stuff
This commit is contained in:
parent
14aca77bfc
commit
b8ae4947b6
|
@ -476,10 +476,20 @@ _efl_canvas_video_aspect_border_apply(Evas_Object *obj, Efl_Canvas_Video_Data *s
|
||||||
|
|
||||||
int aspect_opt = 0;
|
int aspect_opt = 0;
|
||||||
|
|
||||||
|
/* Prefer (if available) the video aspect ratio to calculate the sizes */
|
||||||
|
if (sd->ratio > 0.0)
|
||||||
|
{
|
||||||
|
ir = sd->ratio;
|
||||||
|
ih = sd->video.h;
|
||||||
|
iw = (double)ih * ir;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
iw = sd->video.w;
|
iw = sd->video.w;
|
||||||
ih = sd->video.h;
|
ih = sd->video.h;
|
||||||
|
|
||||||
ir = (double)iw / ih;
|
ir = (double)iw / ih;
|
||||||
|
}
|
||||||
|
|
||||||
r = (double)w / h;
|
r = (double)w / h;
|
||||||
|
|
||||||
/* First check if we should fit the width or height of the video inside the
|
/* First check if we should fit the width or height of the video inside the
|
||||||
|
|
Loading…
Reference in New Issue