From b0af85d3c3771a94f268372f8be318bd3a86d9f2 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 3 Feb 2020 23:29:41 +0100 Subject: [PATCH] widget: remove scale detection hack from Editor Now that text layout and shaping operate on concrete sizes and not units, Editor no longer needs to detect scaling changes. Remove it. Signed-off-by: Elias Naur --- widget/editor.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/widget/editor.go b/widget/editor.go index a49a7929..7787bba3 100644 --- a/widget/editor.go +++ b/widget/editor.go @@ -34,7 +34,6 @@ type Editor struct { Submit bool eventKey int - scale int font text.Font textSize fixed.Int26_6 blinkStart time.Time @@ -230,11 +229,6 @@ func (e *Editor) Layout(gtx *layout.Context, sh text.Shaper, font text.Font, siz } func (e *Editor) layout(gtx *layout.Context, sh text.Shaper) { - // Crude configuration change detection. - if scale := gtx.Px(unit.Sp(100)); scale != e.scale { - e.invalidate() - e.scale = scale - } cs := gtx.Constraints e.carWidth = fixed.I(gtx.Px(unit.Dp(1)))