From bed5902476c408308230c4d4dfb53e81d4ca1a6e Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 19 Feb 2022 12:15:48 +0100 Subject: [PATCH] widget: remove pointer area padding from Editor Pointer padding was introduced in bfece0bebacb5cec4fdf5682b886333e03b6549b. 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 --- widget/editor.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/widget/editor.go b/widget/editor.go index e722a10c..90433ff2 100644 --- a/widget/editor.go +++ b/widget/editor.go @@ -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