def drawn(self, widget, cr):
if self._draw_image is None:
return
with self._size_lock:
img = self._draw_image
if self._show_orientation:
img = img.copy()
self._orient_scaled.composite(
img, 0, 0, img.props.width, img.props.height, 0, 0, 1, 1,
GdkPixbuf.InterpType.NEAREST, 215)
img = img.rotate_simple(self._rotation)
rect = self.get_allocation()
Gdk.cairo_set_source_pixbuf(cr, img,
(rect.width - img.props.width) // 2,
(rect.height - img.props.height) // 2)
cr.paint()
self._draw_pending.clear()
评论列表
文章目录