gui.py 文件源码

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

项目:python-sense-emu 作者: RPi-Distro 项目源码 文件源码
def resized(self, widget, rect):
        with self._size_lock:
            if self._rotation in (0, 180):
                ratio = min(
                    rect.width / self._board_full.props.width,
                    rect.height / self._board_full.props.height)
            else:
                ratio = min(
                    rect.width / self._board_full.props.height,
                    rect.height / self._board_full.props.width)
            ratio = min(ratio, 1.0) # never resize larger than native
            if ratio != self._ratio:
                # Only resize if necessary (plenty of resizes wind up with the
                # same ratio)
                self._board_scaled = self._board_full.scale_simple(
                    self._board_full.props.width * ratio,
                    self._board_full.props.height * ratio,
                    GdkPixbuf.InterpType.BILINEAR)
                self._grid_scaled = self._grid_full.scale_simple(
                    self._grid_full.props.width * ratio,
                    self._grid_full.props.height * ratio,
                    GdkPixbuf.InterpType.BILINEAR)
                self._orient_scaled = self._orient_full.scale_simple(
                    self._orient_full.props.width * ratio,
                    self._orient_full.props.height * ratio,
                    GdkPixbuf.InterpType.BILINEAR)
                self._ratio = ratio
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号