From 2d7fb556a40dfb443d8113dd56f3c0b4e1dbf601 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 8 May 2019 17:55:42 +0200 Subject: [PATCH] ui/test: invalidate Editor layout on scale changes Signed-off-by: Elias Naur --- ui/text/editor.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/text/editor.go b/ui/text/editor.go index fb07d04f..414e5e7b 100644 --- a/ui/text/editor.go +++ b/ui/text/editor.go @@ -61,6 +61,9 @@ const ( ) func (e *Editor) Update(c *ui.Config, pq pointer.Events, kq key.Events) { + if e.cfg == nil || c.PxPerDp != e.cfg.PxPerDp || c.PxPerSp != e.cfg.PxPerSp { + e.invalidate() + } e.cfg = c sbounds := e.scrollBounds() var smin, smax int @@ -136,7 +139,7 @@ func (e *Editor) Layout(ops *ui.Ops, cs layout.Constraints) layout.Dimens { } if maxWidth != e.maxWidth { e.maxWidth = maxWidth - e.valid = false + e.invalidate() } e.layout()