Changeset 8348:a5f5917ae82f in orange


Ignore:
Timestamp:
07/03/11 09:35:34 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
903694557aff4dc3de95c9e2858556545211f3a7
Message:

Only update zoom for items with a defined set_graph_transform method (i.e. curves)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/OWGraphQt.py

    r8342 r8348  
    457457        self.zoom_transform = self.transform_for_zoom(self._zoom_factor, self._zoom_point, self.graph_area) 
    458458        self.zoom_rect = self.zoom_transform.mapRect(self.graph_area) 
    459          
     459        
    460460        for c in self.itemList(): 
    461461            x,y = c.axes() 
    462             qDebug('Updating item ' + repr(c)) 
    463             c.set_graph_transform(self.transform_for_axes(x,y) * self.zoom_transform) 
    464             c.updateProperties() 
     462            if hasattr(c, 'set_graph_transform'): 
     463                c.set_graph_transform(self.transform_for_axes(x,y) * self.zoom_transform) 
     464                c.updateProperties() 
     465            else: 
     466                ## This shouldn't happen, but it's possible to add such items to the graph 
     467                ## The check could be removed if all visualizations are well-behaved 
     468                qDebug(' !!     Warning: an item without set_graph_transform            !!') 
     469                qDebug(' !! Make sure all your curves inherit from Graph.item.PlotItem  !!') 
    465470         
    466471        for a in self.axes.values(): 
Note: See TracChangeset for help on using the changeset viewer.