Fix crash in solvespace-cli
`window` is a `nullptr` with guinone.cpp - avoid dereferencing it. Fixes: https://github.com/solvespace/solvespace/issues/567pull/517/head^2
parent
3ea8ebfaf5
commit
6558cb9ebe
|
@ -305,9 +305,16 @@ void GraphicsWindow::GroupSelection() {
|
||||||
|
|
||||||
Camera GraphicsWindow::GetCamera() const {
|
Camera GraphicsWindow::GetCamera() const {
|
||||||
Camera camera = {};
|
Camera camera = {};
|
||||||
|
if(window) {
|
||||||
window->GetContentSize(&camera.width, &camera.height);
|
window->GetContentSize(&camera.width, &camera.height);
|
||||||
camera.pixelRatio = window->GetDevicePixelRatio();
|
camera.pixelRatio = window->GetDevicePixelRatio();
|
||||||
camera.gridFit = (window->GetDevicePixelRatio() == 1);
|
camera.gridFit = (window->GetDevicePixelRatio() == 1);
|
||||||
|
} else { // solvespace-cli
|
||||||
|
camera.width = 297.0; // A4? Whatever...
|
||||||
|
camera.height = 210.0;
|
||||||
|
camera.pixelRatio = 1.0;
|
||||||
|
camera.gridFit = camera.pixelRatio == 1.0;
|
||||||
|
}
|
||||||
camera.offset = offset;
|
camera.offset = offset;
|
||||||
camera.projUp = projUp;
|
camera.projUp = projUp;
|
||||||
camera.projRight = projRight;
|
camera.projRight = projRight;
|
||||||
|
|
Loading…
Reference in New Issue