Fixed uninitialized grid size in some cases.

This commit is contained in:
leo 2015-01-02 01:07:41 +00:00
parent 343ed3a1fd
commit 6f3694fb89
2 changed files with 5 additions and 3 deletions

View file

@ -2561,9 +2561,6 @@ bool lcModel::GetSelectionCenter(lcVector3& Center) const
bool lcModel::GetPiecesBoundingBox(float BoundingBox[6], bool IncludeHidden) const bool lcModel::GetPiecesBoundingBox(float BoundingBox[6], bool IncludeHidden) const
{ {
if (mPieces.IsEmpty())
return false;
BoundingBox[0] = FLT_MAX; BoundingBox[0] = FLT_MAX;
BoundingBox[1] = FLT_MAX; BoundingBox[1] = FLT_MAX;
BoundingBox[2] = FLT_MAX; BoundingBox[2] = FLT_MAX;
@ -2571,6 +2568,9 @@ bool lcModel::GetPiecesBoundingBox(float BoundingBox[6], bool IncludeHidden) con
BoundingBox[4] = -FLT_MAX; BoundingBox[4] = -FLT_MAX;
BoundingBox[5] = -FLT_MAX; BoundingBox[5] = -FLT_MAX;
if (mPieces.IsEmpty())
return false;
for (int PieceIdx = 0; PieceIdx < mPieces.GetSize(); PieceIdx++) for (int PieceIdx = 0; PieceIdx < mPieces.GetSize(); PieceIdx++)
{ {
lcPiece* Piece = mPieces[PieceIdx]; lcPiece* Piece = mPieces[PieceIdx];

View file

@ -5,6 +5,7 @@
#include "lc_mainwindow.h" #include "lc_mainwindow.h"
#include "view.h" #include "view.h"
#include "project.h" #include "project.h"
#include "lc_colors.h"
#include <QApplication> #include <QApplication>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
@ -182,6 +183,7 @@ int main(int argc, char *argv[])
lcQMainWindow w; lcQMainWindow w;
gMainWindow->mHandle = &w; gMainWindow->mHandle = &w;
lcGetActiveModel()->UpdateInterface(); lcGetActiveModel()->UpdateInterface();
gMainWindow->SetColorIndex(lcGetColorIndex(4));
gMainWindow->UpdateRecentFiles(); gMainWindow->UpdateRecentFiles();
w.show(); w.show();