ui/app: implement window insets for iOS

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-07 23:50:16 +02:00
parent c884b7d4f0
commit 2292fd0c63
2 changed files with 8 additions and 3 deletions
+5 -1
View File
@@ -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,