~eliasnaur/gio

48e9cdaffd75219d76ffe5bd7df275cbb553bc72 — Elias Naur 2 years ago 53da73d
widget: emit only one ChangeEvent per Editor.Layout

ChangeEvent contains no information, so emitting multiple instances
per layout is pointless.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
1 files changed, 3 insertions(+), 3 deletions(-)

M widget/editor.go
M widget/editor.go => widget/editor.go +3 -3
@@ 374,9 374,9 @@ func (e *Editor) processKey(gtx layout.Context) {
			e.caret.start = e.closestPosition(combinedPos{runes: ke.Start}).runes
			e.caret.end = e.closestPosition(combinedPos{runes: ke.End}).runes
		}
		if e.rr.Changed() {
			e.events = append(e.events, ChangeEvent{})
		}
	}
	if e.rr.Changed() {
		e.events = append(e.events, ChangeEvent{})
	}
}