Programming environment for editing various of my live apps without restarting them.

make moving a definition more polished+performant

This is a long-standing problem:

  • each definition requires an edit buffer and some decoration (the rectangle for the background color)
  • while the mouse is down during a move it's nice to see the decorations change
  • but to change decorations we have to go all the way back to A(), which is very slow if there's lots of definitions on the surface

My compromise until now was to just perform B(), not A(). This tore the background rect away from the editor buffer during a move, which was ugly. You also wouldn't get any feedback at all if you tried to move a buffer without any text.

New solution: create a variant of A called A1 that only does the work of A for a single key (index) in Definitions.

This requires tracking for every shape we render in Surface, which key in Definitions it is part of. That way we can selectively delete just shapes belonging to a single key.

Caveat: key is a scalar, so this approach can't handle any nesting, only a flat array of objects. But that's good enough for both driver.love and this app.

Created by  Kartik K. Agaram  on April 18, 2023
7KX3WBFEXMIHNKWNF4NUOBW5HO3PEL3ZEFFMTAXFOQG6V7BYXZ3AC
Change contents