diff --git a/0031-on.resize b/0031-on.resize index 98d904e..16afb8e 100644 --- a/0031-on.resize +++ b/0031-on.resize @@ -1,12 +1,12 @@ on.resize = function(w, h) _, _, Safe_width, Safe_height = love.window.getSafeArea() for _,pane in ipairs(Panes) do - pane.editor_state.right = math.min(100+30*pane.editor_state.font:getWidth('m'), Safe_width*2/3) + pane.editor_state.right = editor_right_margin() if pane.editor_state.right < pane.editor_state.left then pane.editor_state.right = pane.editor_state.left+1 end pane.editor_state.width = pane.editor_state.right - pane.editor_state.left - pane.editor_state.bottom = Safe_height/2-Line_height + pane.editor_state.bottom = code_editor_bottom_margin() Text.redraw_all(pane.editor_state) update_output_editor(pane) end diff --git a/0070-code_editor_state b/0070-code_editor_state index 01ce93b..62d974b 100644 --- a/0070-code_editor_state +++ b/0070-code_editor_state @@ -1,10 +1,10 @@ code_editor_state = function() local result = edit.initialize_state( Menu_bottom + 20, -- top - Safe_height/2-Line_height, -- bottom + code_editor_bottom_margin(), Menu_left + 50 + Line_number_padding, -- left - math.min(100+30*Font:getWidth('m'), Safe_width*2/3), -- right + editor_right_margin(), Font, Font_height, Line_height) Text.redraw_all(result) return result -end +end \ No newline at end of file diff --git a/0169-editor_right_margin b/0169-editor_right_margin new file mode 100644 index 0000000..339685a --- /dev/null +++ b/0169-editor_right_margin @@ -0,0 +1,3 @@ +editor_right_margin = function() + return math.min(100+30*Font:getWidth('m'), Safe_width*2/3) +end \ No newline at end of file diff --git a/0171-code_editor_bottom_margin b/0171-code_editor_bottom_margin new file mode 100644 index 0000000..071aab2 --- /dev/null +++ b/0171-code_editor_bottom_margin @@ -0,0 +1,3 @@ +code_editor_bottom_margin = function() + return Safe_height/2-Line_height +end \ No newline at end of file