--Bug fixes

-Fix crash when creating a dummy renderer when showing the final render dialog.
 -Fix default tab size with new version of Qt.
This commit is contained in:
Person
2017-12-21 20:09:08 -08:00
parent 6d38e57b38
commit 7a343606b4
7 changed files with 18 additions and 10 deletions

View File

@ -497,7 +497,7 @@ static QString BaseStyle()
#ifndef _WIN32
"QTabBar::tab { height: 3ex; }\n\n"
#else
"QTabBar::tab { height: 5ex; }\n\n"
"QTabBar::tab { height: 3ex; }\n\n"
#endif
"/*This is needed to give the labels on the status bar some padding.*/\n"
"QStatusBar QLabel { padding-left: 2px; padding-right: 2px; }\n\n"

View File

@ -243,6 +243,7 @@ public:
virtual bool CreateRenderer(eRendererType renderType, const vector<pair<size_t, size_t>>& devices, bool updatePreviews, bool shared = true) { return false; }
virtual uint SizeOfT() const { return 0; }
virtual void ClearUndo() { }
virtual void DeleteRenderer() { }
virtual GLEmberControllerBase* GLController() { return nullptr; }
bool RenderTimerRunning();
void StartRenderTimer();
@ -251,7 +252,6 @@ public:
void ClearFinalImages();
void Shutdown();
void UpdateRender(eProcessAction action = eProcessAction::FULL_RENDER);
void DeleteRenderer();
void SaveCurrentRender(const QString& filename, const EmberImageComments& comments, vector<v4F>& pixels, size_t width, size_t height, bool png16Bit, bool transparency);
RendererBase* Renderer() { return m_Renderer.get(); }
vector<v4F>* FinalImage() { return &(m_FinalImage); }
@ -515,6 +515,7 @@ public:
virtual int ProgressFunc(Ember<T>& ember, void* foo, double fraction, int stage, double etaMs) override;
virtual void ClearUndo() override;
virtual GLEmberControllerBase* GLController() override { return m_GLController.get(); }
virtual void DeleteRenderer() override;
private:
//Embers.

View File

@ -93,11 +93,14 @@ void FractoriumEmberControllerBase::UpdateRender(eProcessAction action)
/// <summary>
/// Call Shutdown() then delete the renderer and clear the textures in the output window if there is one.
/// Note the name is somewhat misleading because a new empty renderer is actually created as a placeholder.
/// This is that the program won't crash if the user adjusts any of the controls while the renderer is shut down.
/// </summary>
void FractoriumEmberControllerBase::DeleteRenderer()
template <typename T>
void FractoriumEmberController<T>::DeleteRenderer()
{
Shutdown();
m_Renderer = make_unique<EmberNs::Renderer<float, float>>();
m_Renderer = make_unique<EmberNs::Renderer<T, float>>();
if (GLController())
GLController()->ClearWindow();

View File

@ -120,8 +120,8 @@ void Fractorium::OnAddXformButtonClicked(bool checked) { m_Controller->AddXform(
/// From: All xaos values from the current xform are zero when going to any xform but the new one added, which is 1.
/// To: The xaos value coming from the current xform is 1 and the xaos values from all other xforms are 0, when going to the newly added xform.
/// Take different action when a single xform is selected vs. multiple.
/// Single: Copy current xform's xaos values to the new one.
/// Multiple: Set new xform's xaos values to 1, and except the last entry which is 0.
/// Single: Copy the current xform's xaos values to the new one.
/// Multiple: Set the new xform's xaos values to 1, and except the last entry which is 0.
/// Called when the add xform button is clicked.
/// Resets the rendering process.
/// </summary>