diff --git a/apps/go.mod b/apps/go.mod index a878d394..396c0bc2 100644 --- a/apps/go.mod +++ b/apps/go.mod @@ -3,7 +3,7 @@ module gioui.org/apps go 1.12 require ( - gioui.org/ui v0.0.0-20190710205516-4fadf71992ff + gioui.org/ui v0.0.0-20190711123338-478d56102a83 github.com/google/go-github/v24 v24.0.1 golang.org/x/exp v0.0.0-20190627132806-fd42eb6b336f golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9 diff --git a/ui/app/app.go b/ui/app/app.go index 9b79ca5e..f33e1f5b 100644 --- a/ui/app/app.go +++ b/ui/app/app.go @@ -69,7 +69,7 @@ const ( // monitorScale is the extra scale applied to // monitor outputs to compensate for the extra // viewing distance compared to phone and tables. - monitorScale = 1.50 + monitorScale = 1.20 // minDensity is the minimum pixels per dp to // ensure font and ui legibility on low-dpi // screens. diff --git a/ui/app/os_android.go b/ui/app/os_android.go index d4f265a5..70b51f30 100644 --- a/ui/app/os_android.go +++ b/ui/app/os_android.go @@ -202,10 +202,10 @@ func onFocusChange(env *C.JNIEnv, class C.jclass, view C.jlong, focus C.jboolean func onWindowInsets(env *C.JNIEnv, class C.jclass, view C.jlong, top, right, bottom, left C.jint) { w := views[view] w.insets = Insets{ - Top: ui.Px(float32(top)), - Right: ui.Px(float32(right)), + Top: ui.Px(float32(top)), + Right: ui.Px(float32(right)), Bottom: ui.Px(float32(bottom)), - Left: ui.Px(float32(left)), + Left: ui.Px(float32(left)), } if w.stage >= StageRunning { w.draw(true) diff --git a/ui/app/os_wayland.go b/ui/app/os_wayland.go index 5e267ec9..2ae854a0 100644 --- a/ui/app/os_wayland.go +++ b/ui/app/os_wayland.go @@ -198,17 +198,22 @@ func createNativeWindow(opts *WindowOptions) (*window, error) { scale = s } } - ppdp := ppmm * mmPrDp * monitorScale + ppdp := ppmm * mmPrDp + ppsp := ppdp * fontScale + ppdp *= monitorScale if ppdp < minDensity { ppdp = minDensity } + if ppsp < minDensity { + ppsp = minDensity + } w := &window{ disp: conn.disp, scale: scale, newScale: scale != 1, ppdp: ppdp, - ppsp: ppdp * fontScale, + ppsp: ppsp, notRead: pipe[0], notWrite: pipe[1], }