From 8c776e1d785507e2fca5d258434641a04b41f181 Mon Sep 17 00:00:00 2001 From: "Randall C. O'Reilly" Date: Fri, 22 Mar 2024 01:03:19 -0700 Subject: [PATCH] with fix in ScrollCursorToTarget, we don't need extra render steps -- working well in testing. --- texteditor/nav.go | 3 --- texteditor/render.go | 2 -- 2 files changed, 5 deletions(-) diff --git a/texteditor/nav.go b/texteditor/nav.go index 6193cb6512..bc9c642283 100644 --- a/texteditor/nav.go +++ b/texteditor/nav.go @@ -850,8 +850,6 @@ func (ed *Editor) ScrollCursorInView() bool { } if ed.This().(gi.Widget).IsVisible() { curBBox := ed.CursorBBox(ed.CursorPos) - // fmt.Println("scrolling to:", curBBox, ed.CursorPos) - ed.SetCursorTarget(ed.CursorPos) return ed.ScrollInView(curBBox) } return false @@ -930,7 +928,6 @@ func (ed *Editor) ScrollCursorToTarget() { ed.CursorPos = ed.CursorTarg ed.ScrollCursorToVertCenter() ed.SetFlag(false, EditorTargetSet) - ed.Scene.AddReRender(ed.This().(gi.Widget)) } /////////////////////////////////////////////////////////////////////////////// diff --git a/texteditor/render.go b/texteditor/render.go index 62774eece6..5722ca9663 100644 --- a/texteditor/render.go +++ b/texteditor/render.go @@ -34,10 +34,8 @@ func (ed *Editor) RenderLayout() { chg := ed.ManageOverflow(3, true) ed.LayoutAllLines() ed.ConfigScrolls() - // _ = chg if chg { ed.Layout.NeedsLayout() // required to actually update scrollbar vs not - // ed.Scene.AddReRender(ed.This().(gi.Widget)) } }