Extract dpi_scale_factor() to a function.
[dcpomatic.git] / src / wx / wx_util.cc
index a0beb8f72d0f4e7ac92b7be74e2b06ae52b756af..47a6bd5b05141a704ed08a86b3df64c39b9d3d57 100644 (file)
@@ -673,3 +673,18 @@ gui_is_dark ()
 #endif
 }
 
+
+#if wxCHECK_VERSION(3,1,0)
+double
+dpi_scale_factor (wxWindow* window)
+{
+       return window->GetDPIScaleFactor();
+}
+#else
+double
+dpi_scale_factor (wxWindow*)
+{
+       return 1;
+}
+#endif
+