mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
app/internal/window: correct baseline DPI on Windows, iOS
Updates gio#53 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -309,6 +309,7 @@ func (w *window) draw(sync bool) {
|
||||
if width == 0 || height == 0 {
|
||||
return
|
||||
}
|
||||
const inchPrDp = 1.0 / 160
|
||||
ppdp := float32(w.dpi) * inchPrDp
|
||||
w.callbacks.Event(FrameEvent{
|
||||
FrameEvent: system.FrameEvent{
|
||||
|
||||
@@ -81,6 +81,7 @@ func onDraw(view C.CFTypeRef, dpi, sdpi, width, height C.CGFloat, sync C.int, to
|
||||
if sync != 0 {
|
||||
isSync = true
|
||||
}
|
||||
const inchPrDp = 1.0 / 163
|
||||
w.w.Event(FrameEvent{
|
||||
FrameEvent: system.FrameEvent{
|
||||
Size: image.Point{
|
||||
|
||||
@@ -486,6 +486,7 @@ func convertKeyCode(code uintptr) (rune, bool) {
|
||||
func configForDC(hdc syscall.Handle) config {
|
||||
hmon := monitorFromPoint(point{}, _MONITOR_DEFAULTTOPRIMARY)
|
||||
dpi := getDpiForMonitor(hmon, _MDT_EFFECTIVE_DPI)
|
||||
const inchPrDp = 1.0 / 96.0
|
||||
ppdp := float32(dpi) * inchPrDp
|
||||
return config{
|
||||
pxPerDp: ppdp,
|
||||
|
||||
@@ -106,7 +106,3 @@ func newWindowRendezvous() *windowRendezvous {
|
||||
}()
|
||||
return wr
|
||||
}
|
||||
|
||||
const (
|
||||
inchPrDp = 1.0 / 160
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user