diff --git a/NEWS.md b/NEWS.md index 85d00a0..e6cb5cf 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ * Fix for using `"svg"` device during knitting (#484) * Fix for correctly getting chunk options during knitting (#485) +* Fix a bug in `transition_reveal()` that would remove terminal data (#480) # gganimate 1.0.8 diff --git a/R/transition_reveal.R b/R/transition_reveal.R index d61c75c..649648a 100644 --- a/R/transition_reveal.R +++ b/R/transition_reveal.R @@ -123,7 +123,10 @@ TransitionReveal <- ggproto('TransitionReveal', Transition, ) all_frames$group <- paste0(all_frames$group, '<', all_frames$.frame, '>') all_frames$.frame <- NULL - all_frames[!(c(diff(all_frames$.time), 1) <= .Machine$double.eps & all_frames$.phase == 'raw'), ] + repeated <- c(diff(all_frames$.time), 1) <= .Machine$double.eps & + c(all_frames$group[-nrow(all_frames)] == all_frames$group[-1], TRUE) & + all_frames$.phase == 'raw' + all_frames[!repeated, ] } )