Commit Graph

7 Commits

Author SHA1 Message Date
Kartik K. Agaram 50e84c9b44 bugfix: switch text_input to new panning impl 2023-10-27 23:01:46 -07:00
Kartik K. Agaram f6f13542a2 document this very important lesson
I had it once already in my grasp, in pensieve.love, but it slipped
through my fingers. Let's see if this attempt sticks.
2023-10-25 19:47:27 -07:00
Kartik K. Agaram 45c1e42de2 snapshot: a cleaner organization
scenarios:
  * Zoom = 1
    * pan with mouse: ✓
    * pan with up arrow: ✓
    * pan with down arrow: ✓
  * Zoom < 1
    * pan with mouse: ✓
    * pan with up arrow: ✓
    * pan with down arrow: ✗
  * Zoom > 1
    * pan with mouse: ✓
    * pan with up arrow: ✗
    * pan with down arrow: ✓

What ✓ means:
* pan with mouse: lines don't slide relative to the surface
  * will still slide relative to the surface when zooming in/out;
    that's unavoidable because we want integer pixels for crisp text
* pan with keyboard: at least some part of cursor is always peeking within the viewport
  * might still look ugly, with the line containing the cursor almost invisible,
    but hitting the down arrow will never pan upwards, or vice versa

Still not working though. I'm pretty much guaranteeing by construction that if
Viewport.y was set from screen_top1, then screen_top1 will not be perturbed.
And yet using scale() inside update_editor_box is incorrect. Hmm..
2023-10-25 16:49:39 -07:00
Kartik K. Agaram 0a37b1b80c revert commit 4c8960b5c7
Well, almost. I'm just reminding myself of the sort of plumbing I need,
not reintroducing the old logic that never worked right and had
undergone n iterations of corruption.
2023-10-25 16:23:28 -07:00
Kartik K. Agaram 09b8f985db backport a bugfix from driver.love
Ignore typing if cursor isn't in viewport.
2023-10-22 11:45:48 -07:00
Kartik K. Agaram 4c8960b5c7 greatly simplify layout
I don't know why this was so hard, but I don't need this variable
preserve_screen_top_of_cursor_node at all. We only set it when the
cursor is in some node, but we also only check for when the current node
is the cursor. Comparing with a nil cursor node works just as well.

I've also checked that driver.love doesn't need
preserve_screen_top_of_cursor_node. I think it came from pensieve.love,
where I've since taken it out. Did I ever need it even there?
2023-10-21 09:57:44 -07:00
Kartik K. Agaram b138f1ff9b Merge template-live-editor 2023-04-16 11:30:56 -07:00