Skip to content

Commit 5cce66c

Browse files
committed
Fix jittering resolution calculation. Fixes #572
1 parent 0719eed commit 5cce66c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/position-jitter.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ PositionJitter <- proto(Position, {
3333
if (empty(data)) return(data.frame())
3434
check_required_aesthetics(c("x", "y"), names(data), "position_jitter")
3535

36-
if (is.null(.$width)) .$width <- resolution(data$x) * 0.4
37-
if (is.null(.$height)) .$height <- resolution(data$y) * 0.4
36+
if (is.null(.$width)) .$width <- resolution(data$x, zero = FALSE) * 0.4
37+
if (is.null(.$height)) .$height <- resolution(data$y, zero = FALSE) * 0.4
3838

3939
trans_x <- NULL
4040
trans_y <- NULL

0 commit comments

Comments
 (0)