Skip to content

Commit

Permalink
fix export plot on linux (resolve aliased path before calling save as…
Browse files Browse the repository at this point in the history
… png)
  • Loading branch information
jjallaire committed Mar 22, 2011
1 parent b29e6fc commit 3305127
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/cpp/session/modules/SessionPlots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,18 @@ Error refreshPlot(const json::JsonRpcRequest& request,
Error exportPlot(const json::JsonRpcRequest& request,
json::JsonRpcResponse* pResponse)
{
// get args
std::string path;
int width, height;
json::readParams(request.params, &path, &width, &height);
return r::session::graphics::display().savePlotAsPng(FilePath(path),
Error error = json::readParams(request.params, &path, &width, &height);
if (error)
return error;

// resolve path
FilePath plotPath = module_context::resolveAliasedPath(path);

// save plot
return r::session::graphics::display().savePlotAsPng(plotPath,
width,
height);
}
Expand Down

0 comments on commit 3305127

Please sign in to comment.