let's see if this is easier to understand in 6 mos
I spent 4 days agonizing over a bug in driver.love, working up the courage to think about it, and then a whole day trying to make sense of scrolling and deeply questioning my right to tell anyone anything about programming.
This commit is contained in:
parent
09b8f985db
commit
e93b2796d2
|
@ -1,14 +1,13 @@
|
|||
update_editor_box = function(node)
|
||||
if node.editor == nil then return end
|
||||
-- Compute screen_top1 in viewport coordinates because the editor's font takes scaling into account.
|
||||
if vy(node.y) > 0 then
|
||||
if node.y > Viewport.y then
|
||||
if node ~= Cursor_node then
|
||||
node.editor.screen_top1.line = 1
|
||||
node.editor.screen_top1.pos = 1
|
||||
end
|
||||
node.editor.top = vy(node.y)
|
||||
else
|
||||
node.editor.screen_top1, node.editor.top = schema1_of_y(node.editor, -vy(node.y))
|
||||
node.editor.screen_top1, node.editor.top = schema1_of_y(node.editor, scale(Viewport.y-node.y)) -- scale y because editor's font is scaled
|
||||
end
|
||||
node.editor.left = math.floor(vx(node.x))
|
||||
node.editor.right = math.ceil(vx(node.x+node.w))
|
||||
|
|
Loading…
Reference in New Issue