X22MOJHFLXMZQJN4IP2HAXIIVD2ALPR4EO5V5YDYF6QPXS7ZNB6QC J3ER7DFO2TXYUMJAXZUFEHQNLFDNIXSYDTE7HEFGQ2RYB3A6RFPAC 3ZTODUBQ727WK7NTCYBCEBBL4ASOQ6FB37GZM6W3SSTN5FEKGQHAC OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC BYG5CEMVXANDTBI2ORNVMEY6K3EBRIHZHS4QBK27VONJC5537COQC 2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC 4BX4GJEWW7Z5LA4SJUXADYLAHOYFL4IBOYH4J4DJYRAVKKGGFHGQC MTJEVRJR5GLWUSK7HMIM4UXM6GS6O6YCRWJT3DUSU2RYMHCQNOEQC LNUHQOGHIOFGJXNGA3DZLYEASLYYDGLN2I3EDZY5ANASQAHCG3YQC LF7BWEG4DKQI7NMXMZC4LC2BE5PB42HK5PD6OYBNIDMAZBJASOKQC PTDO2SOTXEI6FROZ2AVRFXSKKNKCRMPPTQSI5LWD45UVGDJPMSGQC --? love.graphics.setColor(0,0,1)--? love.graphics.line(pane.left, pane.top, pane.left + Display_settings.column_width, pane.top)--? love.graphics.line(pane.left, pane.top + Cache[pane.id].height - Padding_vertical*2, pane.left + Display_settings.column_width, pane.top + Cache[pane.id].height - Padding_vertical*2)
--? function App.update(dt)--? Cursor_time = Cursor_time + dt--? -- some hysteresis while resizing--? if Last_resize_time then--? if App.getTime() - Last_resize_time < 0.1 then--? return--? else--? Last_resize_time = nil--? end--? end--? if App.mouse_x() >= Editor_state.left-Margin_left and App.mouse_x() < Editor_state.right+Margin_right then--? love.mouse.setCursor(love.mouse.getSystemCursor('arrow'))--? edit.update(Editor_state, dt)--? else--? love.mouse.setCursor(love.mouse.getSystemCursor('hand'))--? end--? if Pan.x then--? Editor_state.left = Margin_left - math.max(Pan.x-App.mouse_x(), 0)--? Editor_state.right = 400 + Margin_right - math.max(Pan.x-App.mouse_x(), 0)--? Editor_state.width = Editor_state.right - Editor_state.left--? Editor_state.top = Margin_top - math.max(Pan.y-App.mouse_y(), 0)--? --? Display_settings.x = math.max(Pan.x-App.mouse_x(), 0)--? --? Display_settings.y = math.max(Pan.y-App.mouse_y(), 0)--? --? App.mouse_move(Pan.x-Display_settings.x, Pan.y-Display_settings.y)--? end--? end--?
function App.update(dt)Cursor_time = Cursor_time + dt-- some hysteresis while resizingif Last_resize_time thenif App.getTime() - Last_resize_time < 0.1 thenreturnelseLast_resize_time = nilendendif App.mouse_y() < Header_height then-- column headerlove.mouse.setCursor(love.mouse.getSystemCursor('arrow'))elseif in_pane(App.mouse_x(), App.mouse_y()) thenlove.mouse.setCursor(love.mouse.getSystemCursor('arrow'))elselove.mouse.setCursor(love.mouse.getSystemCursor('hand'))endif Pan.x thenDisplay_settings.x = math.max(Pan.x-App.mouse_x(), 0)Display_settings.y = math.max(Pan.y-App.mouse_y(), 0)endendfunction in_pane(x,y)local sx,sy = to_surface(x,y)local x = Gutter_width + Padding_horizontalfor column_idx, column in ipairs(Surface) doif sx < x thenreturn falseendif sx < x + Margin_left + Display_settings.column_width + Margin_right thenlocal y = Margin_topfor pane_idx, pane in ipairs(column) doif sy < y thenreturn falseendif sy < y + Cache[pane.id].height - Padding_vertical*2 thenreturn trueendy = y + Cache[pane.id].heightendendx = x + Margin_left + Display_settings.column_width + Margin_right + Padding_horizontal + Gutter_width + Padding_horizontalendreturn falseendfunction to_surface(x, y)return x+Display_settings.x, y+Display_settings.yend
--? end--?--? function App.mousepressed(x,y, mouse_button)--? Cursor_time = 0 -- ensure cursor is visible immediately after it moves--? if x >= Editor_state.left - Margin_left and x < Editor_state.right + Margin_right then--? return edit.mouse_pressed(Editor_state, x,y, mouse_button)--? else--? Pan = {x=x, y=y}--? end--? end--?--? function App.mousereleased(x,y, mouse_button)--? Cursor_time = 0 -- ensure cursor is visible immediately after it moves--? if x >= Editor_state.left - Margin_left and x < Editor_state.right + Margin_right then--? return edit.mouse_released(Editor_state, x,y, mouse_button)--? else--? Pan = {}--? end
--?
function App.mousepressed(x,y, mouse_button)Cursor_time = 0 -- ensure cursor is visible immediately after it movesSelection_first = {}Selection_second = {}Pan = {}if y < Margin_top then-- column headers currently not interactablereturnendlocal sx,sy = to_surface(x,y)if not in_pane(x,y) thenPan = {x=sx, y=sy}returnendendfunction App.mousereleased(x,y, mouse_button)Cursor_time = 0 -- ensure cursor is visible immediately after it movesPan = {}end
-- insert new drawingbutton('draw', {x=State.left - Margin_left + 4,y=y+4, w=12,h=12, color={1,1,0},--? icon = icon.insert_drawing,onpress1 = function()Drawing.before = snapshot(State, line_index-1, line_index)table.insert(State.lines, line_index, {mode='drawing', y=y, h=256/2, points={}, shapes={}, pending={}})if State.cursor1.line >= line_index thenState.cursor1.line = State.cursor1.line+1endschedule_save(State)record_undo_event(State, {before=Drawing.before, after=snapshot(State, line_index-1, line_index+1)})end,})
if State.show_cursor thenbutton('draw', {x=State.left - Margin_left + 4,y=y+4, w=12,h=12, color={1,1,0},--? icon = icon.insert_drawing, -- TODOonpress1 = function()Drawing.before = snapshot(State, line_index-1, line_index)table.insert(State.lines, line_index, {mode='drawing', y=y, h=256/2, points={}, shapes={}, pending={}})if State.cursor1.line >= line_index thenState.cursor1.line = State.cursor1.line+1endschedule_save(State)record_undo_event(State, {before=Drawing.before, after=snapshot(State, line_index-1, line_index+1)})end,})end