Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit d6f758f103888cd1b92e6e8dcc7b9d27203f26ef
- Author: Lauri Myllari <lauri.myllari@gmail.com>
- Date: Fri Jan 17 15:44:25 2014 -0800
- [X11] Use exact aspect ratio for 16:9 and 4:3 displays
- diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp
- index c95f4ec..43aa737 100644
- --- a/xbmc/windowing/X11/WinSystemX11.cpp
- +++ b/xbmc/windowing/X11/WinSystemX11.cpp
- @@ -373,8 +373,18 @@ void CWinSystemX11::UpdateResolutions()
- res.iWidth = mode.h;
- res.iHeight = mode.w;
- }
- - if (mode.h>0 && mode.w>0 && out->hmm>0 && out->wmm>0)
- - res.fPixelRatio = ((float)out->wmm/(float)mode.w) / (((float)out->hmm/(float)mode.h));
- + if (mode.h>0 && mode.w>0 && out->hmm>0 && out->wmm>0) {
- + float aspectx, aspecty;
- + float phyaspect = (float)out->wmm / (float)out->hmm;
- + if (fabs(1-((16.0/9)/phyaspect)) < 0.01) {
- + aspectx = 16.0; aspecty = 9.0;
- + } else if (fabs(1-((4.0/3)/phyaspect)) < 0.01) {
- + aspectx = 4.0; aspecty = 3.0;
- + } else {
- + aspectx = (float)out->wmm; aspecty = (float)out->hmm;
- + }
- + res.fPixelRatio = (aspectx/(float)mode.w) / ((aspecty/(float)mode.h));
- + }
- else
- res.fPixelRatio = 1.0f;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement