20 lines
726 B
Plaintext
20 lines
726 B
Plaintext
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 ~= 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))
|
|
end
|
|
if node.editor.font_height ~= scale(20) then
|
|
edit.update_font_settings(node.editor, scale(20))
|
|
end
|
|
node.editor.left = math.floor(vx(node.x)) + Line_number_width*App.width('m')
|
|
node.editor.right = math.ceil(vx(node.x+node.w))
|
|
node.editor.width = node.editor.right - node.editor.left
|
|
end
|