# HG changeset patch # User Santeri Piippo # Date 1375157808 -10800 # Node ID 89a9235b47d3b273284307b3fd6963c6332d34ba # Parent af39fae829f6e7a2e57900d77a91dba52322f9d6 Use repaint() instead of update() when redrawing the scene after a pick so that the new scene is repainted immediately. diff -r af39fae829f6 -r 89a9235b47d3 src/file.cpp --- a/src/file.cpp Tue Jul 30 02:27:12 2013 +0300 +++ b/src/file.cpp Tue Jul 30 07:16:48 2013 +0300 @@ -454,8 +454,7 @@ g_loadedFiles << f; LDOpenFile::setCurrent (f); - if (g_loadedFiles.size() == 2) - LDOpenFile::closeInitialFile (0); + LDOpenFile::closeInitialFile(); g_win->R()->setFile (f); g_win->fullRefresh(); @@ -520,8 +519,7 @@ // If we have an anonymous, unchanged file open as the only open file // (aside of the one we just opened), close it now. - if (g_loadedFiles.size() == 2) - LDOpenFile::closeInitialFile (0); + LDOpenFile::closeInitialFile(); // Rebuild the object tree view now. g_win->fullRefresh(); @@ -954,7 +952,14 @@ g_win->updateFileListItem (f); } -void LDOpenFile::closeInitialFile (ulong idx) { - if (g_loadedFiles.size() > idx && g_loadedFiles[idx]->name() == "" && !g_loadedFiles[idx]->hasUnsavedChanges()) - delete g_loadedFiles[idx]; +// ============================================================================= +// This little beauty closes the initial file that was open at first when opening +// a new file over it. +void LDOpenFile::closeInitialFile() { + if (g_loadedFiles.size() == 2 && + g_loadedFiles[0]->name() == "" && + !g_loadedFiles[0]->hasUnsavedChanges()) + { + delete g_loadedFiles[0]; + } } \ No newline at end of file diff -r af39fae829f6 -r 89a9235b47d3 src/file.h --- a/src/file.h Tue Jul 30 02:27:12 2013 +0300 +++ b/src/file.h Tue Jul 30 07:16:48 2013 +0300 @@ -127,7 +127,7 @@ static void closeUnused(); static LDOpenFile* current(); static void setCurrent (LDOpenFile* f); - static void closeInitialFile (ulong idx); + static void closeInitialFile(); private: static LDOpenFile* m_curfile; diff -r af39fae829f6 -r 89a9235b47d3 src/gldraw.cpp --- a/src/gldraw.cpp Tue Jul 30 02:27:12 2013 +0300 +++ b/src/gldraw.cpp Tue Jul 30 07:16:48 2013 +0300 @@ -1185,7 +1185,7 @@ glEnable (GL_DITHER); setBackground(); - update(); + repaint(); } // =============================================================================