Commit graph

11 commits

Author SHA1 Message Date
Jonathan Johnson
6726855ed0
Cleaning up figures usage in examples 2024-07-26 10:34:30 -07:00
Jonathan Johnson
20ae2b7c72
map_each deadlock prevention
map_each previously was written such that if a chain of mappings fed
each other, a deadlock could occur because while the first one was
mapped, the second callback gets invoked and tries to update the first
value while it's still being held.

This refactor switches from std Mutex to parking_lot, allowing me to
remove a workaround for needing to run drop callbacks in a separate
thread during the drop of a DynamicGuard.

In addition to that change, the lower level `map_generational` calls now
take a DynamicGuard as their parameter. This allows these functions to
drop ownership of the referenced data during the callback.

The map_each implementation takes advantage of this by ensuring that the
guard is dropped before set is invoked, minimizing potential lock overlaps.

With this refactor, some old code of mine with complex validations now works
again.
2024-04-05 16:14:26 -07:00
Jonathan Johnson
bc52be440f
Added animation recording + event wiring
Not great, but it technically exists.
2024-01-03 17:45:11 -08:00
Jonathan Johnson
be0399279c
Initial implementation of offscreen rendering 2024-01-03 11:35:43 -08:00
Jonathan Johnson
e70e92726c
Source<T> + Destination<T> (breaking)
Refs #98

This refactor overhauls the reactive system to move all the reactive
methods to traits. The side effect of this change is that now
DynamicReader's API is the same as Dynamic's API, but because it only
implements Source<T>, DynamicReader does not offer any mutation
functions.

While it's unfortunate to have more traits to include to use Cushy, this
seems like the best option, and it offers a path to try to integrate
this into the tuple ForEach/MapEach traits. Unfortunately, my attempt at
doing those in this set of changes led to issues specifying generic
associated lifetimes for the DynamicGuard. But, I was also in the middle
of this larger refactoring, so it might be that a fresh attempt will
succeed.
2024-01-02 09:00:29 -08:00
Jonathan Johnson
2fe28729df
Directly depending on figures
While this was a workaround for a docs.rs issue (Px/Lp are not
linked), I decided having the shorter import path would look better in
the examples.

It probably wasn't necessary to update all of the references in the
internal code, but I decided it was worth the consistency.
2023-12-28 09:35:24 -08:00
Jonathan Johnson
df479e983e
Renaming crate to Cushy
Refs #117
2023-12-27 19:02:59 -08:00
Jonathan Johnson
02d6b343f1
Widget docs + refactoring
- MakeWidgetWithId::make_with_id -> MakeWidgetWithTag::make_With_tag
- ManagedWidget -> MountedWidget
- *_refresh -> *_redraw, standardized on terminology
- get_tracked -> get_tracking_redraw
2023-12-17 07:38:31 -08:00
Jonathan Johnson
8a4c66e73b
Refactored to MakeWidgetWithId 2023-11-30 09:14:19 -08:00
Jonathan Johnson
e15ae59c5c
Refactored root resize behavior
Closes #84, Closes #77, Closes #78
2023-11-25 12:00:59 -08:00
Jonathan Johnson
bb66803653
Custom widget, layout size rounding
Closes #56
2023-11-20 10:11:10 -08:00