Changeset 183


Ignore:
Timestamp:
Nov 22, 2010 9:22:32 AM (12 years ago)
Author:
vondreele
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimgGUI.py

    r139 r183  
    5050        imax = int(maxSel.GetValue())*sqrtDeltZero/100.
    5151        data['range'][1][1] = imax**2+data['range'][0][0]
    52         data['range'][1][0] = min(data['range'][1][1]-1,data['range'][1][0])
     52        data['range'][1][0] = max(0.0,min(data['range'][1][1]-1,data['range'][1][0]))
    5353        DeltOne = data['range'][1][1]-data['range'][0][0]
    5454        minSel.SetValue(int(100*(data['range'][1][0]-data['range'][0][0])/DeltOne))
     
    5858        DeltOne = data['range'][1][1]-data['range'][0][0]
    5959        imin = int(minSel.GetValue())*DeltOne/100.
    60         data['range'][1][0] = min(data['range'][1][1]-1,imin)+data['range'][0][0]
     60        data['range'][1][0] = max(0.0,min(data['range'][1][1]-1,imin)+data['range'][0][0])
    6161        G2plt.PlotExposedImage(self,event=event)
    6262       
     
    290290    maxSizer = wx.FlexGridSizer(2,2,0,5)
    291291    maxSizer.AddGrowableCol(1,1)
    292     sqrtDeltZero = math.sqrt(data['range'][0][1]-data['range'][0][0])
    293     DeltOne = data['range'][1][1]-data['range'][0][0]
     292    sqrtDeltZero = math.sqrt(data['range'][0][1]-max(0.0,data['range'][0][0]))
     293    DeltOne = data['range'][1][1]-max(0.0,data['range'][0][0])
    294294    sqrtDeltOne = math.sqrt(DeltOne)
    295295    maxSizer.Add(wx.StaticText(parent=self.dataDisplay,label=' Max intensity'),0,
     
    302302        wx.ALIGN_CENTER_VERTICAL|wx.EXPAND)
    303303    minSel = wx.Slider(parent=self.dataDisplay,style=wx.SL_HORIZONTAL,
    304         value=int(100*(data['range'][1][0]-data['range'][0][0])/DeltOne))
     304        value=int(100*(data['range'][1][0]-max(0.0,data['range'][0][0]))/DeltOne))
    305305    maxSizer.Add(minSel,1,wx.EXPAND|wx.RIGHT)
    306306    minSel.Bind(wx.EVT_SLIDER, OnMinSlider)
Note: See TracChangeset for help on using the changeset viewer.