~ubuntu-branches/ubuntu/utopic/python-chaco/utopic

« back to all changes in this revision

Viewing changes to chaco/base_1d_mapper.py

  • Committer: Package Import Robot
  • Author(s): Andrew Starr-Bochicchio
  • Date: 2014-06-01 17:04:08 UTC
  • mfrom: (7.2.5 sid)
  • Revision ID: package-import@ubuntu.com-20140601170408-m86xvdjd83a4qon0
Tags: 4.4.1-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
 - Let the binary-predeb target work on the usr/lib/python* directory
   as we don't have usr/share/pyshared anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    # the ratio if both screen and data space extents are non-zero.
33
33
    stretch_data = Bool(True)
34
34
 
 
35
    # The sign of the mapping: 1 if deltas match sign, -1 if opposite sign
 
36
    sign = Property
 
37
 
35
38
    # If the subclass uses a cache, _cache_valid is maintained to
36
39
    # monitor its status
37
40
    _cache_valid = Bool(False)
74
77
    def _get_screen_bounds(self):
75
78
        return (self.low_pos, self.high_pos)
76
79
 
 
80
    def _get_sign(self):
 
81
        delta_screen = (self.high_pos - self.low_pos)
 
82
        delta_data = (self.range.high-self.range.low)
 
83
        if delta_screen == 0 or delta_data == 0:
 
84
            return 0
 
85
        elif delta_screen/float(delta_data) < 0:
 
86
            return -1
 
87
        else:
 
88
            return 1
 
89
 
77
90
    def _set_screen_bounds(self, new_bounds):
78
91
        if new_bounds[0] == self.low_pos and new_bounds[1] == self.high_pos:
79
92
            return