14f75d67e3bd275bc1be3c416bb5ffeb9dffd33f,hyperspy/drawing/_widgets/range.py,ModifiableSpanSelector,move_left,#ModifiableSpanSelector#Any#,442

Before Change


                self.move_right(event)
            return
        width_increment = self._range[0] - x
        if self.rect.get_width() + width_increment <= 0:
            return
        self.rect.set_x(x)
        self.rect.set_width(self.rect.get_width() + width_increment)
        self.update_range()
        self.events.moved.trigger(self)
        self.events.resized.trigger(self)

After Change


                                        self.move_left)
        self._range = (r0, r1)

    def move_left(self, event):
        if self.buttonDown is False or self.ignore(event):
            return
        x = self._get_mouse_position(event)
        if self.step_ax is not None:
            if (self.bounds_check and
                    x < self.step_ax.low_value - self.step_ax.scale):
                return
            if self.snap_position:
                snap_offset = self.step_ax.offset - 0.5 * self.step_ax.scale
            elif self.snap_size:
                snap_offset = self._range[1]
            if self.snap_position or self.snap_size:
                rem = (x - snap_offset) % self.step_ax.scale
                if rem / self.step_ax.scale < 0.5:
                    rem = -rem
                else:
                    rem = self.step_ax.scale - rem
                x += rem
        // Do not move the left edge beyond the right one.
        if x >= self._range[1]:
            if self.can_switch and x > self._range[1]:
                self.switch_left_right(x, True)
                self.move_right(event)
            return
        width_increment = self._range[0] - x
        if self._get_span_width() + width_increment <= 0:
            return
        self._set_span_x(x)
        self.rect.set_width(self._get_span_width() + width_increment)
        self.update_range()
        self.events.moved.trigger(self)
        self.events.resized.trigger(self)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: hyperspy/hyperspy
Commit Name: 14f75d67e3bd275bc1be3c416bb5ffeb9dffd33f
Time: 2018-07-16
Author: eric.prestat@gmail.com
File Name: hyperspy/drawing/_widgets/range.py
Class Name: ModifiableSpanSelector
Method Name: move_left


Project Name: hyperspy/hyperspy
Commit Name: 14f75d67e3bd275bc1be3c416bb5ffeb9dffd33f
Time: 2018-07-16
Author: eric.prestat@gmail.com
File Name: hyperspy/drawing/_widgets/range.py
Class Name: ModifiableSpanSelector
Method Name: move_left


Project Name: hyperspy/hyperspy
Commit Name: 14f75d67e3bd275bc1be3c416bb5ffeb9dffd33f
Time: 2018-07-16
Author: eric.prestat@gmail.com
File Name: hyperspy/drawing/_widgets/range.py
Class Name: ModifiableSpanSelector
Method Name: move_right


Project Name: hyperspy/hyperspy
Commit Name: 14f75d67e3bd275bc1be3c416bb5ffeb9dffd33f
Time: 2018-07-16
Author: eric.prestat@gmail.com
File Name: hyperspy/drawing/_widgets/range.py
Class Name: ModifiableSpanSelector
Method Name: update_range