Skip to content

Commit

Permalink
Bugfix: Redraw after all view property changes
Browse files Browse the repository at this point in the history
Fixes #417
  • Loading branch information
LaCuneta committed Dec 1, 2023
1 parent 508506a commit 7434f97
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/assets/javascripts/beak/widgets/ractives/widget.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ RactiveWidget = RactiveDraggableAndContextable.extend({
uniqueEvents =
events.reduce(((acc, x) -> if not acc.find((y) -> y.type is x.type)? then acc.concat([x]) else acc), [])

# Special casing this feels a bit silly, but it works, and given the special casing for plots, I guess it's
# par for the course. Necessary because if the redraw happens before all changes are applied (topology and
# world coordinates) then the unapplied stuff is lost. -Jeremy B December 2023
uniqueEvents.sort( (event1, event2) ->
if (event1.type is 'redrawView') then 1 else if (event2.type is 'redrawView') then -1 else 0
)

for event in uniqueEvents
realEvent =
if event.type is "recompile-for-plot"
Expand Down

0 comments on commit 7434f97

Please sign in to comment.