sliceviewwidget.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:segyviewer 作者: Statoil 项目源码 文件源码
def _subplot_scrolled(self, event):
        keys = event['key']
        if not keys:
            # at least 1 step per event but a maximum of 5
            step = max(1, abs(int(event['step'])))
            step = min(step, 5)
            step = copysign(step, event['step'])

            slice_model = self._get_slice_view(event).model()
            index = int(slice_model.index + step)

            if 0 <= index < len(slice_model):
                self._context.update_index_for_direction(slice_model.index_direction, index)

        elif keys.state(ctrl=True) or keys.state(shift=True):
            x = event['x']
            y = event['y']
            step = max(1, abs(int(event['step'])))
            step = copysign(step / 20.0, event['step'])

            slice_view = self._get_slice_view(event)

            if slice_view.zoom(x, y, step):
                self._context_changed()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号