From 92a31b84bf3731a40b745480b390239be03ba361 Mon Sep 17 00:00:00 2001 From: Ken D'Ambrosio Date: Fri, 5 Jun 2026 08:56:04 -0400 Subject: Fix flipped-sprite draw offset (right-facing sheep unclickable) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The flip clip rect (-tile_w, 0, tile_w, tile_h) mapped to device x [dest_x+tile_w, dest_x+2*tile_w] — one tile_w off to the right — so the visual and the input hit-box didn't overlap for right-facing sheep. Correct clip is (0, 0, tile_w, tile_h) with source offset -sx/-sy. Co-Authored-By: Claude Sonnet 4.6 --- esheep.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'esheep.py') diff --git a/esheep.py b/esheep.py index cf2d670..29e03d2 100644 --- a/esheep.py +++ b/esheep.py @@ -699,9 +699,9 @@ def draw_frame(cr: cairo.Context, surface: cairo.ImageSurface, if flip: cr.translate(dest_x + tile_w, dest_y) cr.scale(-1, 1) - cr.rectangle(-tile_w, 0, tile_w, tile_h) + cr.rectangle(0, 0, tile_w, tile_h) cr.clip() - cr.set_source_surface(surface, -tile_w - sx, -sy) + cr.set_source_surface(surface, -sx, -sy) else: cr.translate(dest_x, dest_y) cr.rectangle(0, 0, tile_w, tile_h) -- cgit v1.2.3