When scale is empty, default to 1.0 for profile and preview

This commit is contained in:
Ferdi van der Werf 2012-04-18 16:08:58 +02:00
parent 57cd3cccd3
commit 0a4fa748a8

View file

@ -131,7 +131,12 @@ class previewPanel(wx.Panel):
self.OnScale(None)
def OnScale(self, e):
profile.putProfileSetting('model_scale', self.scale.GetValue())
scale = 1.0
if self.scale.GetValue() != '':
scale = float(self.scale.GetValue())
if scale <= 0.0:
scale = 1.0
profile.putProfileSetting('model_scale', scale)
self.updateModelTransform()
def OnScaleMax(self, e):