widget: remove pointer area padding from Editor

Pointer padding was introduced in bfece0beba.
I don't remember why, and its commit message doesn't say. Regardless, adding
padding outside a widget's reported dimensions doesn't seem like a good idea
(see #365), and this change removes it.

Fixes: https://todo.sr.ht/~eliasnaur/gio/365
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-02-19 12:15:48 +01:00
parent 20d4bc21d5
commit bed5902476
+1 -7
View File
@@ -625,13 +625,7 @@ func (e *Editor) layout(gtx layout.Context, content layout.Widget) layout.Dimens
key.SoftKeyboardOp{Show: true}.Add(gtx.Ops)
}
e.requestFocus = false
pointerPadding := gtx.Px(unit.Dp(4))
r := image.Rectangle{Max: e.viewSize}
r.Min.X -= pointerPadding
r.Min.Y -= pointerPadding
r.Max.X += pointerPadding
r.Max.X += pointerPadding
defer clip.Rect(r).Push(gtx.Ops).Pop()
defer clip.Rect(image.Rectangle{Max: e.viewSize}).Push(gtx.Ops).Pop()
pointer.CursorNameOp{Name: pointer.CursorText}.Add(gtx.Ops)
var scrollRange image.Rectangle