def overlay(self, other_component, gc, view_bounds=None, mode="normal"): c = other_component self.do_layout(component=c) with gc: gc.clip_to_rect(c.x, c.y, c.width, c.height) Container._draw(self, gc, view_bounds) return
def overlay(self, other_component, gc, view_bounds=None, mode="normal"): c = other_component self.do_layout(component=c) gc.save_state() try: gc.clip_to_rect(c.x, c.y, c.width, c.height) Container._draw(self, gc, view_bounds) finally: gc.restore_state() return