mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
ui/app: implement window insets for iOS
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+5
-1
@@ -63,7 +63,7 @@ func onCreate(view C.CFTypeRef) {
|
||||
}
|
||||
|
||||
//export onDraw
|
||||
func onDraw(view C.CFTypeRef, dpi, sdpi, width, height C.CGFloat, sync C.int) {
|
||||
func onDraw(view C.CFTypeRef, dpi, sdpi, width, height C.CGFloat, sync C.int, top, right, bottom, left C.CGFloat) {
|
||||
if width == 0 || height == 0 {
|
||||
return
|
||||
}
|
||||
@@ -83,6 +83,10 @@ func onDraw(view C.CFTypeRef, dpi, sdpi, width, height C.CGFloat, sync C.int) {
|
||||
X: int(width + .5),
|
||||
Y: int(height + .5),
|
||||
},
|
||||
Insets: image.Rectangle{
|
||||
Min: image.Point{X: int(left + .5), Y: int(top + .5)},
|
||||
Max: image.Point{X: int(right + .5), Y: int(bottom + .5)},
|
||||
},
|
||||
Config: ui.Config{
|
||||
PxPerDp: float32(dpi) * inchPrDp,
|
||||
PxPerSp: float32(sdpi) * inchPrDp,
|
||||
|
||||
Reference in New Issue
Block a user