mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
widget: simplify Editor.offsetToScreenPos
It used to return an iterator function, now it just takes the result of a previous call. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -151,7 +151,7 @@ func TestEditorCaretConsistency(t *testing.T) {
|
||||
t.Helper()
|
||||
gotLine, gotCol := e.CaretPos()
|
||||
gotCoords := e.CaretCoords()
|
||||
want, _ := e.offsetToScreenPos(e.caret.start.ofs)
|
||||
want := e.offsetToScreenPos(combinedPos{}, e.caret.start.ofs)
|
||||
wantCoords := f32.Pt(float32(want.x)/64, float32(want.y))
|
||||
if want.lineCol.Y != gotLine || want.lineCol.X != gotCol || gotCoords != wantCoords {
|
||||
return fmt.Errorf("caret (%d,%d) pos %s, want (%d,%d) pos %s",
|
||||
|
||||
Reference in New Issue
Block a user