I might have finally hit on the right approach: a hotkey that dumps information. Doesn't swamp me with data, and also doesn't perturb anything.
y_of_schema1 returns consistent results as I pan around. I'm just not actually printing the lines at that y. I'm printing it at that y/Viewport.zoom.
What might be confusing here is that I started out with a simple mental model:
But for text quality reasons I need to perform many computations in "scaled surface" coordinates.
Viewport coordinates are both offset and scaled relative to surface coordinates. Scaled surface = just scaled relative to surface, not offset.
I don't have a clear mental model here for when to use this.
I did already use it in one place with my simple mental model: you have to scale distances like rect.w and rect.h but it's incorrect to offset them. Maybe I'm getting this wrong somehow.
F5BF4M6KKVFYOO65BMF3TNRTYIOHNVVMPLEQSSX6UCNOOEQMKIIAC
XRAQBRS4CZ6T6TSQLCMTS4OENCCGWYEBZ52RK42PV6NMMNZZPKUAC
6KFND4SU2O7UDJVSS74YI3PI453ZFCBM72P6TWLI7DSKFEVUQVFQC
R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC
WKMW7PCE75A5CFXF5GPL5HQ4ZNASFOFQFHASOQ7LABSQKWU3KEGAC
QJAYOFWY7V4BWVLJMEDCCBC2HX4BDAZI6PQVLWCLYRHWGMOBFTVAC
P36KIMZCWGBG6CZQE3W5SVTCJMYZOVEZ3U3FAF46SO5ZMMM42PHQC
YOCTF4J3GCMKKVKGO2N5NGHNCRG6FLD54QPI5RGLK4OP667D3NVAC
BF7TW3EKRIDYC6J2Q2J4YOBAVQF55Y3H6KGZIHNXMH4N72MR6GXQC
AUZQ7ULP65IGCJYIT3U6R42HEJT35R33TQHA7XNK242KWCV6IKMAC
dump_state = function()
print('===')
print('zoom', Viewport.zoom)
print('viewport', Viewport.y)
print('node', Page.data[1].y)
print('node renders from', Page.data[1].editor.top)
print('screen top', Page.data[1].editor.screen_top1.line)
local l = 25
print('y of line', l, y_of_schema1(Page.data[1].editor, {line=l, pos=1}))
end