diff options
author | Chris Michael <cp.michael@samsung.com> | 2017-06-07 11:21:19 -0400 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2017-06-07 11:21:19 -0400 |
commit | c7da93c1de14d3d685c9d86289274c9441bb91c4 (patch) | |
tree | 6634deb4747a2cbb6a7b12dab4f891107ea0789c | |
parent | 5ee913426d0e0326122f7d29407ce481a0a3af22 (diff) | |
download | efl-c7da93c1de14d3d685c9d86289274c9441bb91c4.tar.gz |
ecore-wl2: Use output height when calculating dpi
When calculating output dpi, we should also be considering output
height in the calculation.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r-- | src/lib/ecore_wl2/ecore_wl2_output.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_output.c b/src/lib/ecore_wl2/ecore_wl2_output.c index abd43f2581..ba1d7cea8f 100644 --- a/src/lib/ecore_wl2/ecore_wl2_output.c +++ b/src/lib/ecore_wl2/ecore_wl2_output.c @@ -120,16 +120,24 @@ _ecore_wl2_output_del(Ecore_Wl2_Output *output) EAPI int ecore_wl2_output_dpi_get(Ecore_Wl2_Output *output) { - int w, mw; + int w, h, mw, mh, dpi; + double target; EINA_SAFETY_ON_NULL_RETURN_VAL(output, 75); mw = output->mw; if (mw <= 0) return 75; + mh = output->mh; + if (mh <= 0) return 75; + w = output->geometry.w; + h = output->geometry.h; + + target = (round((sqrt(mw * mw + mh * mh) / 25.4) * 10) / 10); + dpi = (round((sqrt(w * w + h * h) / target) * 10) / 10); - return (((w * 254) / mw) + 5) / 10; + return dpi; } EAPI int |