2023-10-21 17:54:12 +01:00
|
|
|
update_editor_box = function(node)
|
2023-01-03 11:15:03 +00:00
|
|
|
if node.editor == nil then return end
|
2023-10-23 03:50:08 +01:00
|
|
|
if node.y > Viewport.y then
|
2023-10-21 17:54:12 +01:00
|
|
|
if node ~= Cursor_node then
|
2023-01-03 11:15:03 +00:00
|
|
|
node.editor.screen_top1.line = 1
|
|
|
|
node.editor.screen_top1.pos = 1
|
|
|
|
end
|
|
|
|
node.editor.top = vy(node.y)
|
|
|
|
else
|
2023-10-23 03:50:08 +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
|
2023-10-23 03:39:54 +01:00
|
|
|
node.editor.top = node.editor.top + Menu_bar_height
|
2023-01-03 11:15:03 +00:00
|
|
|
end
|
2023-05-01 06:36:09 +01:00
|
|
|
if node.editor.font_height ~= scale(20) then
|
|
|
|
edit.update_font_settings(node.editor, scale(20))
|
|
|
|
end
|
2023-06-18 19:16:02 +01:00
|
|
|
node.editor.left = math.floor(vx(node.x))
|
2023-01-03 11:15:03 +00:00
|
|
|
node.editor.right = math.ceil(vx(node.x+node.w))
|
2023-04-23 06:21:42 +01:00
|
|
|
node.editor.width = node.editor.right - node.editor.left
|
2023-06-22 06:22:13 +01:00
|
|
|
end
|