CLI: fix crash running the "thumbnail" command.
parent
0fb9a4cc23
commit
350d2ad211
|
@ -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++) {
|
||||||
|
|
Loading…
Reference in New Issue