Skip to content
Snippets Groups Projects
Commit 402ec95a authored by stepan's avatar stepan
Browse files

Fix downViewport with vpPath

parent 0bb1bca8
Branches
No related tags found
No related merge requests found
...@@ -48,6 +48,10 @@ find.viewport <- function(path, name, strict, currPath, pvp, depth) { ...@@ -48,6 +48,10 @@ find.viewport <- function(path, name, strict, currPath, pvp, depth) {
} }
} }
growPathFixed <- function(pathsofar, name) {
if (is.null(pathsofar)) name else grid:::growPath(pathsofar, name)
}
find.in.children <- function(path, name, strict, currPath, children, depth) { find.in.children <- function(path, name, strict, currPath, children, depth) {
cpvps <- ls(env=children) cpvps <- ls(env=children)
ncpvp <- length(cpvps) ncpvp <- length(cpvps)
...@@ -55,7 +59,7 @@ find.in.children <- function(path, name, strict, currPath, children, depth) { ...@@ -55,7 +59,7 @@ find.in.children <- function(path, name, strict, currPath, children, depth) {
found <- FALSE found <- FALSE
while (count < ncpvp && !found) { while (count < ncpvp && !found) {
child <- get(cpvps[count + 1L], env=children) child <- get(cpvps[count + 1L], env=children)
nextCurrPath <- if (path == 0L) NULL else grid:::growPath(currPath, child$name) nextCurrPath <- if (path == 0L) NULL else growPathFixed(currPath, child$name)
result <- find.viewport(path, name, strict, nextCurrPath, child, depth) result <- find.viewport(path, name, strict, nextCurrPath, child, depth)
if (result[[1L]]) { if (result[[1L]]) {
return(result); return(result);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment