Skip to content

Commit

Permalink
Improve chromote_get_xy()
Browse files Browse the repository at this point in the history
  • Loading branch information
ashbythorpe committed Nov 2, 2023
1 parent eac0f95 commit 5252998
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/utils-chromote.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ chromote_get_xy <- function(node_id = NULL, backend_id = NULL, driver) {
driver$DOM$getBoxModel(backendNodeId = backend_id)$model$content
}

x <- (coords[[1]] + coords[[3]]) / 2
y <- (coords[[2]] + coords[[6]]) / 2
x <- mean(range(unlist(coords[seq(1, 7, 2)])))
y <- mean(range(unlist(coords[seq(2, 8, 2)])))
list(x = x, y = y)
}

Expand Down

0 comments on commit 5252998

Please sign in to comment.