pothi.love/0030-update_editor_box

23 lines
872 B
Plaintext
Raw Normal View History

update_editor_box = function(node, skip_updating_screen_top_for)
if node.editor == nil then return end
2023-10-26 05:25:08 +01:00
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
Text.redraw_all(node.editor)
if node.y > Viewport.y then
if node ~= skip_updating_screen_top_for then
node.editor.screen_top1.line = 1
node.editor.screen_top1.pos = 1
end
node.editor.top = vy(node.y)
else
if node ~= skip_updating_screen_top_for then
2023-10-26 04:05:50 +01:00
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
node.editor.top = node.editor.top + Menu_bar_height
2022-12-26 00:56:47 +00:00
end
end
end