Skip to content

Commit

Permalink
#5231: Prevent divisions by zero using the entry box in the Transform…
Browse files Browse the repository at this point in the history
…ationDialog's scale controls
  • Loading branch information
codereader committed Jul 1, 2020
1 parent a829a7f commit 48b9553
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions radiant/ui/transform/TransformDialog.cpp
Expand Up @@ -10,6 +10,7 @@
#include "registry/Widgets.h"

#include "wxutil/ControlButton.h"
#include "wxutil/dialog/MessageBox.h"

#include <wx/panel.h>
#include <wx/sizer.h>
Expand Down Expand Up @@ -305,6 +306,12 @@ void TransformDialog::onClickSmaller(wxCommandEvent& ev, EntryRow* row)
else
{
// Do a scale
if (float_equal_epsilon(step, 0.0f, 0.0001f))
{
wxutil::Messagebox::ShowError(_("Cannot scale by zero or near-zero values"));
return;
}

Vector3 scaleXYZ(1,1,1);

// Store the value into the right axis
Expand Down

0 comments on commit 48b9553

Please sign in to comment.