Skip to content
Snippets Groups Projects
Commit c2f50ee4 authored by Zbyněk Šlajchrt's avatar Zbyněk Šlajchrt
Browse files

[GR-2798] Missing DL initialization fixed.

PullRequest: fastr/1601
parents 77a310de 62f70061
No related branches found
No related tags found
No related merge requests found
......@@ -64,6 +64,9 @@ eval(expression({
if (!missing(displaylist)) {
displaylist <- match.arg(displaylist)
grid::grid.display.list(displaylist == "enable")
if (displaylist == "enable") {
.Call(grid:::C_initDisplayList)
}
}
else stop("argument is missing with no default")
invisible()
......@@ -73,12 +76,12 @@ eval(expression({
recordPlot <- function() {
dl <- grid:::grid.Call(grid:::C_getDisplayList)
dl.idx <- grid:::grid.Call(grid:::C_getDLindex)
# The dummy elements and the class 'recordedplot' make the display list look
# like the GNUR one, which enables its use in the 'evaluate' package
# (used in knitr, for instance).
if (all(sapply(dl, function (x) is.null(x)))) {
if (all(sapply(dl[-1], function (x) is.null(x)))) {
pl <- list(NULL)
} else {
# The dummy elements and the class 'recordedplot' make the display list look
# like the GNUR one, which enables its use in the 'evaluate' package
# (used in knitr, for instance).
pl <- list(list(list("dummyCallX",list(list("dummyCallY")))), dl = dl, dl.idx = dl.idx)
}
class(pl) <- "recordedplot"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment