forked from joejulian/gio
ui/app: tweak monitor scale
Don't apply monitor scale to wayland font sizes, since it detects the user scale itself. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
@@ -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],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user