From 42fb4c69c56f3c9227d4287ab9ad018a9020f719 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Fri, 2 Nov 2012 20:06:21 +0100 Subject: [PATCH] metrics: add iOS support for Metrics.density/Metrics.dpi --- kivy/metrics.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kivy/metrics.py b/kivy/metrics.py index 2b2aff71c..8699a4b86 100644 --- a/kivy/metrics.py +++ b/kivy/metrics.py @@ -156,6 +156,9 @@ class Metrics(object): if platform() == 'android': import android return android.get_dpi() + elif platform() == 'ios': + import ios + return ios.get_dpi() # for all other platforms.. from kivy.base import EventLoop @@ -189,6 +192,9 @@ class Metrics(object): import jnius Hardware = jnius.autoclass('org.renpy.android.Hardware') return Hardware.metrics.scaledDensity + elif platform() == 'ios': + import ios + return ios.get_scale() return 1.0