Changeset 4096


Ignore:
Timestamp:
Aug 16, 2019 12:43:05 PM (4 years ago)
Author:
toby
Message:

fix broken plot arrow keys; add some debug for where drag of ticks fails

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r4094 r4096  
    732732class GSASIItoolbar(Toolbar):
    733733    'Override the matplotlib toolbar so we can add more icons'
    734     arrows = {}
    735        
    736734    def __init__(self,plotCanvas,publish=None):
    737735        '''Adds additional icons to toolbar'''
     736        self.arrows = {}
    738737        # try to remove a button from the bar
    739738        POS_CONFIG_SPLTS_BTN = 6 # position of button to remove
     
    20142013       
    20152014    def OnMotion(event):
    2016        
     2015        'Update the status line with infor based on the mouse position'       
    20172016        SetCursor(Page)
    20182017        if event.button and G2frame.Contour and G2frame.TforYaxis:
     
    23922391            G2frame.cid = None
    23932392        if event.xdata is None or event.ydata is None: # ignore drag if cursor is outside of plot
     2393            if GSASIIpath.GetConfigValue('debug'): print('Ignoring drag, invalid pos:',event.xdata,event.ydata)
    23942394            wx.CallAfter(PlotPatterns,G2frame,plotType=plottype,extraKeys=extraKeys)
    23952395            return
    23962396        if not G2frame.PickId:
     2397            if GSASIIpath.GetConfigValue('debug'): print('Ignoring drag, G2frame.PickId is not set')
    23972398            return
    23982399       
     
    24402441       
    24412442        if G2frame.itemPicked is None:
    2442             # after any mouse release event (could be a zoom), redraw magnification lines
     2443            # after any mouse release event (could be a zoom) where nothing is selected,
     2444            # redraw magnification lines
    24432445            if magLineList: wx.CallAfter(PlotPatterns,G2frame,plotType=plottype,extraKeys=extraKeys)
    24442446            return
     
    25202522                data[1][0] = min(max(data[0][0],data[1][0]),data[1][1])
    25212523                data[1][1] = max(min(data[0][1],data[1][1]),data[1][0])
    2522         elif (G2frame.GPXtree.GetItemText(PickId) == 'Reflection Lists' or \
     2524        elif (G2frame.GPXtree.GetItemText(PickId) == 'Reflection Lists' or
    25232525            'PWDR' in G2frame.GPXtree.GetItemText(PickId)) and xpos:
    25242526            Id = G2gd.GetGPXtreeItemId(G2frame,PatternId,'Reflection Lists')
     
    25332535                        else:       #1st row of refl ticks
    25342536                            Page.plotStyle['refOffset'] = event.ydata
     2537        elif GSASIIpath.GetConfigValue('debug'): # should not happen!
     2538            print('How did we get here?')
     2539            GSASIIpath.IPyBreak()
    25352540        PlotPatterns(G2frame,plotType=plottype,extraKeys=extraKeys)
    25362541        G2frame.itemPicked = None
Note: See TracChangeset for help on using the changeset viewer.