CLI: fix crash running the "thumbnail" command.

pull/339/head
whitequark 2018-07-18 02:30:40 +00:00
parent 0fb9a4cc23
commit 350d2ad211
1 changed files with 10 additions and 10 deletions

View File

@ -200,18 +200,18 @@ static bool RunCommand(const std::vector<std::string> args) {
camera.scale = SS.GW.scale; camera.scale = SS.GW.scale;
SS.GenerateAll(); SS.GenerateAll();
CairoPixmapRenderer *pixmapCanvas = (CairoPixmapRenderer *)SS.GW.canvas.get(); CairoPixmapRenderer pixmapCanvas;
pixmapCanvas->antialias = true; pixmapCanvas.antialias = true;
pixmapCanvas->SetLighting(SS.GW.GetLighting()); pixmapCanvas.SetLighting(SS.GW.GetLighting());
pixmapCanvas->SetCamera(camera); pixmapCanvas.SetCamera(camera);
pixmapCanvas->Init(); pixmapCanvas.Init();
SS.GW.canvas->NewFrame(); pixmapCanvas.NewFrame();
SS.GW.Draw(SS.GW.canvas.get()); SS.GW.Draw(&pixmapCanvas);
SS.GW.canvas->FlushFrame(); pixmapCanvas.FlushFrame();
SS.GW.canvas->ReadFrame()->WritePng(output, /*flip=*/true); pixmapCanvas.ReadFrame()->WritePng(output, /*flip=*/true);
pixmapCanvas->Clear(); pixmapCanvas.Clear();
}; };
} else if(args[1] == "export-view") { } else if(args[1] == "export-view") {
for(size_t argn = 2; argn < args.size(); argn++) { for(size_t argn = 2; argn < args.size(); argn++) {