Commit Graph

68 Commits

Author SHA1 Message Date
Kartik K. Agaram 3dccd7f81a stop pretending globals are local
One advantage of this approach: we don't end up with multiple lexical
scopes containing duplicates of the same modules.
2022-07-11 22:11:58 -07:00
Kartik K. Agaram 26a98d027b make freehand drawings smoother
Now I might actually use them more, and maybe I can start considering
taking out some shapes. Do I really need circles if I don't provide
ellipses?

Thanks Ivan Reese for the feedback. "What drawings does your tool
encourage?"

Minor note: taking out the deepcopy creates a cute little string like
effect, where the curve grows tighter the slower you draw it.
2022-07-05 11:38:08 -07:00
Kartik K. Agaram 3422d92a00 bugfix: 'escape' to cancel a stroke
This has been broken since commit b544e8c357 on May 17 :/
I'm just undoing that commit, which turns out to be completely
unnecessary. And adding a test.
2022-07-05 11:06:55 -07:00
Kartik K. Agaram 429a42eb1c right margin 2022-06-30 22:54:34 -07:00
Kartik K. Agaram 8c7bea8f76 rip out notion of Line_width 2022-06-30 19:50:27 -07:00
Kartik K. Agaram 515dad95f9 keep drawings within the line width slider as well 2022-06-22 21:08:17 -07:00
Kartik K. Agaram 97bbc7da7f clean up 2022-06-17 23:16:49 -07:00
Kartik K. Agaram 0248339898 more precise shape selection
It's important that the error be additive rather than multiplicative,
otherwise the area grows asymmetrically along a line.

Hopefully freehand drawings will work more intuitively now.
2022-06-17 23:15:09 -07:00
Kartik K. Agaram 26995dd62e correct commit f3abc2cbf2
I can't be trusted to do anything without a test.

This should fix #5. Please reopen if it doesn't.
2022-06-17 22:53:05 -07:00
Kartik K. Agaram f3abc2cbf2 better handle moving points
This should hopefully address #5. I'm removing some constraints from
manhattan lines, rectangles and squares.
2022-06-17 21:40:59 -07:00
Kartik K. Agaram bed0ddd2b7 dead code 2022-06-15 11:11:06 -07:00
Kartik K. Agaram b1ee70d62c move 2022-06-15 11:10:30 -07:00
Kartik K. Agaram 9644b066bd . 2022-06-15 09:59:18 -07:00
Kartik K. Agaram d77bcd8f8c stop recording points for arcs
It was kinda weird that we were recording the start but not the end.
And moving the start point didn't actually affect the arc.
Let's see if we actually ever need it.
2022-06-15 09:57:49 -07:00
Kartik K. Agaram 4280b19cac move current mode indicator slightly 2022-06-15 09:03:31 -07:00
Kartik K. Agaram a40d2c424e standardize on ordering of cases 2022-06-15 08:53:34 -07:00
Kartik K. Agaram 93a9dfd364 test: moving a point
I found some code in the process that seems unreachable. Some chance of
a regression here..
2022-06-14 21:08:07 -07:00
Kartik K. Agaram 2b4e14189b tests for drawing polygons 2022-06-14 14:59:09 -07:00
Kartik K. Agaram dc3b18eb6c start writing some tests for drawings 2022-06-14 10:50:14 -07:00
Kartik K. Agaram 8c535dbb3a . 2022-06-14 10:50:14 -07:00
Kartik K. Agaram f277a78455 extract variable Margin_left 2022-06-14 10:49:06 -07:00
Kartik K. Agaram c1d8201d44 mouse buttons are integers, not strings
Not sure where that idiom comes from or why strings work in some places
(auto-coercion?). I picked it up off some example apps. But
https://love2d.org/wiki/love.mouse.isDown says it should be an integer.
2022-06-14 09:05:02 -07:00
Kartik K. Agaram 059efba79d override mouse state lookups in tests
If I'd had this stuff in my test harness earlier, two recent commits
would have failed tests and given me early warning:
  ff88238ff1
  ff88a2a927
2022-06-12 09:04:21 -07:00
Kartik K. Agaram 242a087016 set current_drawing_index with current_drawing 2022-06-10 13:44:12 -07:00
Kartik K. Agaram fcfe667fe9 include drawing index in a few places 2022-06-10 13:40:07 -07:00
Kartik K. Agaram c875f7be46 stop saving the entire file when modifying drawings
Now we just disallow that entirely.
2022-06-10 11:48:32 -07:00
Kartik K. Agaram 7d1671051f yet another key conflict 2022-06-04 21:48:35 -07:00
Kartik K. Agaram db8b5b5062 switch circles to 'o' to avoid conflicting with copy 2022-06-04 20:35:31 -07:00
Kartik K. Agaram 9ee5d1c913 try to maintain a reasonable line width 2022-06-04 20:10:56 -07:00
Kartik K. Agaram 9efeae1f82 rename 2022-06-03 08:01:21 -07:00
Kartik K. Agaram 91d79eba33 local var 2022-06-03 08:00:31 -07:00
Kartik K. Agaram 03499f7449 switch freehand hotkey to eliminate conflict with search
I'm now following Inkscape, and the mnemonic is 'pencil'.
2022-06-02 23:55:17 -07:00
Kartik K. Agaram 9bbfc2be13 crisp font rendering 2022-06-02 23:36:07 -07:00
Kartik K. Agaram 22817492a3 rename 2022-06-02 16:44:18 -07:00
Kartik K. Agaram b4e76eac4e bugfix: undo drawing creation
Also clean up drawing state to make sure we don't get into hard-to-debug
situations.
2022-06-02 15:51:44 -07:00
Kartik K. Agaram 670886240f after much struggle, a brute-force undo
Incredibly inefficient, but I don't yet know how to efficiently encode
undo mutations that can span multiple lines.

There seems to be one bug related to creating new drawings; they're not
spawning events and undoing past drawing creation has some weird
artifacts. Redo seems to consistently work, though.
2022-06-02 15:45:25 -07:00
Kartik K. Agaram d0d22fffbc missing temporary modes in a couple more places 2022-05-30 16:23:08 -07:00
Kartik K. Agaram 69eeefe197 missing shape modes in a couple more places 2022-05-30 16:23:01 -07:00
Kartik K. Agaram fd5a47f8bf more robust transitions to temporary modes
I seem to often accidentally press C-n twice to go into name mode. Now
doing so overrides the previous temporary mode (name/move/delete point)
without clobbering the real shape-drawing mode.
2022-05-30 15:34:53 -07:00
Kartik K. Agaram 714f7d11cd experiment: give up on changing shape mode
I often find myself accidentally hovering over some shape or other when
switching modes.

One additional reason to do this: I never included it in the help. So it
hasn't been very high-priority.
2022-05-30 15:34:01 -07:00
Kartik K. Agaram 3414f0a11d bugfix: function names 2022-05-30 15:29:57 -07:00
Kartik K. Agaram 096f6255b2 ignore 'name' mode in a few places 2022-05-30 15:28:50 -07:00
Kartik K. Agaram a603847d18 go through App in a couple more places 2022-05-29 16:37:31 -07:00
Kartik K. Agaram bce43b56b0 few more transitions between shapes 2022-05-25 17:07:19 -07:00
Kartik K. Agaram 6550a4c6d7 couple of TODOs 2022-05-21 16:42:22 -07:00
Kartik K. Agaram 9a18b09de3 bugfix: escape key to hide online help 2022-05-21 14:22:34 -07:00
Kartik K. Agaram 0537f81744 show when we're naming a point 2022-05-21 14:18:31 -07:00
Kartik K. Agaram bb9e23a638 support for naming points
There's still an absence of affordance showing when you're in naming mode.
2022-05-21 14:03:06 -07:00
Kartik K. Agaram 77ba9433d7 one missing transition between shape modes 2022-05-21 09:30:02 -07:00
Kartik K. Agaram 5d8e7a3cc6 several bugfixes
All introduced when I built rectangles and squares in commit e27165cb.
2022-05-21 08:41:54 -07:00