From 6f3694fb897639ef8baf0aa170447b6be8dd3792 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 2 Jan 2015 01:07:41 +0000 Subject: [PATCH] Fixed uninitialized grid size in some cases. --- common/lc_model.cpp | 6 +++--- qt/qtmain.cpp | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common/lc_model.cpp b/common/lc_model.cpp index 02fb8981..5744bc9a 100644 --- a/common/lc_model.cpp +++ b/common/lc_model.cpp @@ -2561,9 +2561,6 @@ bool lcModel::GetSelectionCenter(lcVector3& Center) const bool lcModel::GetPiecesBoundingBox(float BoundingBox[6], bool IncludeHidden) const { - if (mPieces.IsEmpty()) - return false; - BoundingBox[0] = FLT_MAX; BoundingBox[1] = FLT_MAX; BoundingBox[2] = FLT_MAX; @@ -2571,6 +2568,9 @@ bool lcModel::GetPiecesBoundingBox(float BoundingBox[6], bool IncludeHidden) con BoundingBox[4] = -FLT_MAX; BoundingBox[5] = -FLT_MAX; + if (mPieces.IsEmpty()) + return false; + for (int PieceIdx = 0; PieceIdx < mPieces.GetSize(); PieceIdx++) { lcPiece* Piece = mPieces[PieceIdx]; diff --git a/qt/qtmain.cpp b/qt/qtmain.cpp index 6f4eb195..09f82cff 100644 --- a/qt/qtmain.cpp +++ b/qt/qtmain.cpp @@ -5,6 +5,7 @@ #include "lc_mainwindow.h" #include "view.h" #include "project.h" +#include "lc_colors.h" #include #ifdef Q_OS_WIN @@ -182,6 +183,7 @@ int main(int argc, char *argv[]) lcQMainWindow w; gMainWindow->mHandle = &w; lcGetActiveModel()->UpdateInterface(); + gMainWindow->SetColorIndex(lcGetColorIndex(4)); gMainWindow->UpdateRecentFiles(); w.show();