Commit Graph

62 Commits

Author SHA1 Message Date
2d817cc998 adjust app type by adding arrowX and arrowY integer fields, and subsequent refactoring, as preparation for being able to draw with arrow keys 2024-09-20 10:17:57 +01:00
80e1a68843 change ClickPoints.getMousePosition function to return indices to the click points array rather than the click points themselves; this will help adding functionality to use arrows for selecting click points later 2024-09-20 09:07:54 +01:00
415f06f0c0 address second regression mentioned in previous commit, where clicked dots are no longer visible (turns out that I removed a line during refactoring which added the triangle stage coordinates to the dot vector) 2024-09-19 18:54:32 +01:00
6a7f11efe6 address one regression, where triangles were no longer being displayed (because calculation changed) after the previous refactoring. I know of only one more regression, which is that the clicked dots do not persist after moving the mouse. 2024-09-19 17:46:40 +01:00
9153217d5f attempt a little refactoring (but note that this refactoring is untested) 2024-09-16 21:49:05 +01:00
acd68a055d code shortcut to trigger export (with <Ctrl-E>); it outputs syntatically valid .sml, but I am not sure if the output is correct as intended so it needs testing 2024-08-30 02:34:24 +01:00
da2a652506 improve parsing code slightly, with successful parsing when saved .dsc file has inconsistent spacing 2024-08-29 11:18:17 +01:00
24bc45142d slight refactoring (move pure parsing functions to functional core in a separate file) 2024-08-29 09:55:08 +01:00
e69c6b42ef done with loading file into app (loaded triangles are visible, etc.) 2024-08-29 05:38:58 +01:00
2549703dc7 verify that parsing saved file is successful 2024-08-29 05:21:04 +01:00
eb13636993 very basic saving (hardcoded file name, which is fine fow now) 2024-08-29 00:05:30 +01:00
e587c6cf73 preparation for adding new additional threads/mailboxes (namely, the file mailbox) 2024-08-28 20:11:00 +01:00
3f4c52e0d8 upload new dots to GPU when there is a window resize too 2024-08-14 21:35:01 +01:00
30dd9de17a rename 'button' (the coloured square that appears over a clickpoint) to 'dot' throughout codebase, because I may want actual buttons later 2024-08-14 21:24:46 +01:00
abddddbc9e fix minor bug when resizing (resizing caused graph to be drawn and resized, even when graph was toggled off) 2024-08-14 03:54:52 +01:00
9b639c9c53 progress towards toggling graph 2024-08-14 02:31:28 +01:00
0c76edfde2 remove graph lines vector from app type, so the vector can be garbage collected (it is not really needed) 2024-08-13 23:49:34 +01:00
6878f7fa58 a little clean up (make the ClickPoints.getClickPosition easier for callers to use, because fewer arguments need to be passed) 2024-08-13 23:38:04 +01:00
c475a06341 fix minor bug with undo (was meant to call TriangleStage.secondToVector with an initial empty vector in one case, for drawing, but mistakenly used a non-empty vector as initial) 2024-08-11 15:02:04 +01:00
541fdd877f fix minor compiler errors 2024-08-08 23:45:24 +01:00
4d0d8ef0a1 done with functional-core logic for redo (now just need to send REDO_ACTION on key callback when shortcut is pressed) 2024-08-08 23:43:38 +01:00
10b3617689 add redo stack, and adjust functions to clear it when new triangle or triangle_stage is added; when an undo function is called, the undoHd becomes the redoHd, and undo becomes undoTl, which is expected behaviour. Still need to implement REDO_ACTION though. 2024-08-08 23:10:38 +01:00
4243e4c679 refactor a little bit, making signature of app-update.sml simpler to use by storing mouseX and mouseY inside the app_type 2024-08-08 21:58:50 +01:00
89f4ae3b13 undo implemented and working fine 2024-08-08 21:35:48 +01:00
5c7c61586a scaffolding in preparation for implementing undo 2024-08-08 06:34:40 +01:00
a53c5e1ce3 restore imperative shell 2024-08-08 05:56:20 +01:00
1264e20dc8 remove instances of 'local ... in ... end', replacing it with opauque structures with signatures, because I like the lower indentation level and additional whitespace in the latter 2024-08-08 01:37:46 +01:00
d9607d27d8 done refactoring functional core 2024-08-08 00:58:59 +01:00
2dd0ec5c66 additional refactoring (almost 100/home/humza/Downloads/sml/dotscape/dotscape.mlb done refactoring functional core) 2024-08-08 00:50:36 +01:00
894dca2017 begin refactoring 2024-08-08 00:18:03 +01:00
ea5bbe2075 change clickable range 2024-08-06 07:38:46 +01:00
7a6722cf60 done with resize functionality 2024-08-03 07:10:38 +01:00
82db7521b4 amend clickPoints when windowHeight > windowWidth 2024-08-03 06:42:46 +01:00
0d1ea9444b refactor to allow graph lines to be shown at start up 2024-08-03 06:05:26 +01:00
ee2274ffbc improve generated graph lines, so it aligns perfectly with clickPoints (but there are two 'todo' notes: one when the height is greather than the width, and also the constant vector when the program starts is an empty vector) 2024-08-03 04:40:53 +01:00
5a14f5300b done with code to generate graph lines (but I still need to send new graph lines vector as a DrawMsg) 2024-08-03 02:56:45 +01:00
d946addb81 fix bug in wrong parameter sent to 'genClickPoints' function (code was previously sending 0, when it was meant to be passing the 'wStart' variable) 2024-08-03 02:48:00 +01:00
57c21448e7 add and improve code to generate graphLines dynamically 2024-08-03 02:31:35 +01:00
6c444696d4 progress with resizing (triangle and button are always horizontally centred if windowWidth is greater than windowHeight, or windowHeight is greather than windowWidth) 2024-08-02 13:35:48 +01:00
7a584fea3c progress towards resizing 2024-08-02 12:46:00 +01:00
cff2b4f8df progress towards resizing 2024-08-02 05:58:22 +01:00
98f6c63b05 correctly generate click points dynamically, even when window resolution is not a square 2024-08-02 03:09:59 +01:00
b01637ba3b a little refactoring 2024-08-02 00:05:24 +01:00
13063ea2c6 add framebufferSize callback (FFI scaffolding and creating new variant of input_message type but don't react to this message in a meaningful way yet) 2024-08-01 23:33:54 +01:00
c5d9ed4c69 add clickPoints to app-type so we are able to change those points at runtime 2024-08-01 21:39:09 +01:00
0fc6201231 reduce number of type conversoins required for mouse move callback (and fix the other code which uses it too) 2024-08-01 21:17:39 +01:00
818503d0ac formatting 2024-07-31 22:28:42 +01:00
16fa1e49af get drawing of triangles implemented 2024-07-31 22:25:15 +01:00
cf38d160d5 minor optimisation (do not have to branch on NO_TRIANGLE | FIRST | SECOND twice in update function; update function was branching on this itself, and call to 'getTriangleStageVector' was branching again which was redundant) 2024-07-31 21:21:45 +01:00
6e6de41889 keep triangle stages (clicked positions) drawn on screen, until triangle stages resets to NO_TRIANGLE 2024-07-31 21:15:39 +01:00