Skip to content

Commit d54fd69

Browse files
authored
fix misplacing points in position_dodge2 (tidyverse#4936)
Fixes bug which misplaced geom objects when it had zero width.
1 parent 7ddb6d9 commit d54fd69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/position-dodge2.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ find_x_overlaps <- function(df) {
138138
overlaps[1] <- counter <- 1
139139

140140
for (i in seq_asc(2, nrow(df))) {
141-
if (is.na(df$xmin[i]) || is.na(df$xmax[i - 1]) || df$xmin[i] >= df$xmax[i - 1]) {
141+
if (is.na(df$xmin[i]) || is.na(df$xmax[i - 1]) || df$xmin[i] > df$xmax[i - 1]) {
142142
counter <- counter + 1
143143
}
144144
overlaps[i] <- counter

0 commit comments

Comments
 (0)