bf177bb644ee03fbb78e31238367f8990add2155,enthought/chaco/tools/better_zoom.py,BetterZoom,zoom_out,#BetterZoom#Any#,175

Before Change


            if self._zoom_limit_reached(new_value_factor, "x"):
                return
                    
        if self.zoom_to_mouse:
            location = self.position
        else:
            location = (self.component.width/2, self.component.height/2)
            
        zoom_state = ZoomState(location, 
                               (self._index_factor, self._value_factor),
                               (new_index_factor, new_value_factor))
        
        zoom_state.apply(self)
        self._append_state(zoom_state)
                
    def zoom_in_x(self, factor=0):
        if factor == 0:
            factor = self.zoom_factor

After Change


            if self._zoom_limit_reached(new_value_factor, "x"):
                return
                    
        if self.zoom_to_mouse:
            location = self.position
            
            x_map = self._get_x_mapper()
            y_map = self._get_y_mapper()
            
            next = (x_map.map_data(location[0]),
                    y_map.map_data(location[1]))
            prev = (x_map.map_data(self.component.bounds[0]/2),
                    y_map.map_data(self.component.bounds[1]/2))
            
            pan_state = PanState(prev, next)
            zoom_state = ZoomState((self._index_factor, self._value_factor),
                                   (new_index_factor, new_value_factor))
            
            states = GroupedToolState([pan_state, zoom_state])
            states.apply(self)
            self._append_state(states)
        
        else:
                    
            zoom_state = ZoomState((self._index_factor, self._value_factor),
                                   (new_index_factor, new_value_factor))
            
            zoom_state.apply(self)
            self._append_state(zoom_state)
                
    def zoom_in_x(self, factor=0):
        if factor == 0:
            factor = self.zoom_factor
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 49

Instances


Project Name: enthought/chaco
Commit Name: bf177bb644ee03fbb78e31238367f8990add2155
Time: 2010-12-10
Author: bhendrix@651a555e-23ca-0310-84fe-ca9f7c59d2ea
File Name: enthought/chaco/tools/better_zoom.py
Class Name: BetterZoom
Method Name: zoom_out


Project Name: enthought/chaco
Commit Name: bf177bb644ee03fbb78e31238367f8990add2155
Time: 2010-12-10
Author: bhendrix@651a555e-23ca-0310-84fe-ca9f7c59d2ea
File Name: enthought/chaco/tools/better_zoom.py
Class Name: BetterZoom
Method Name: zoom_out


Project Name: enthought/chaco
Commit Name: bf177bb644ee03fbb78e31238367f8990add2155
Time: 2010-12-10
Author: bhendrix@651a555e-23ca-0310-84fe-ca9f7c59d2ea
File Name: enthought/chaco/tools/better_zoom.py
Class Name: BetterZoom
Method Name: zoom_in_y


Project Name: enthought/chaco
Commit Name: bf177bb644ee03fbb78e31238367f8990add2155
Time: 2010-12-10
Author: bhendrix@651a555e-23ca-0310-84fe-ca9f7c59d2ea
File Name: enthought/chaco/tools/better_zoom.py
Class Name: BetterZoom
Method Name: zoom_in_x


Project Name: enthought/chaco
Commit Name: bf177bb644ee03fbb78e31238367f8990add2155
Time: 2010-12-10
Author: bhendrix@651a555e-23ca-0310-84fe-ca9f7c59d2ea
File Name: enthought/chaco/tools/better_zoom.py
Class Name: BetterZoom
Method Name: zoom_out_x


Project Name: enthought/chaco
Commit Name: bf177bb644ee03fbb78e31238367f8990add2155
Time: 2010-12-10
Author: bhendrix@651a555e-23ca-0310-84fe-ca9f7c59d2ea
File Name: enthought/chaco/tools/better_zoom.py
Class Name: BetterZoom
Method Name: zoom_in