Skip to content

Commit

Permalink
with fix in ScrollCursorToTarget, we don't need extra render steps --…
Browse files Browse the repository at this point in the history
… working well in testing.
  • Loading branch information
rcoreilly committed Mar 22, 2024
1 parent 0f63905 commit 8c776e1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
3 changes: 0 additions & 3 deletions texteditor/nav.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
}

///////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 0 additions & 2 deletions texteditor/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}

Expand Down

0 comments on commit 8c776e1

Please sign in to comment.