fix(app): initialize overlay with canvas dimensions and offset draw_frame by padding
This commit is contained in:
+9
-5
@@ -48,10 +48,10 @@ class CatserApp:
|
||||
|
||||
# 3. Transparent Overlay Window
|
||||
self.overlay = OverlayWindow(
|
||||
width=self.config.cat_width,
|
||||
height=self.config.cat_height,
|
||||
initial_x=int(self.controller.x),
|
||||
initial_y=int(self.controller.y),
|
||||
width=self.config.canvas_width,
|
||||
height=self.config.canvas_height,
|
||||
initial_x=int(self.controller.x - self.config.pad_x),
|
||||
initial_y=int(self.controller.y - self.config.pad_y),
|
||||
on_mouse_down=self.controller.on_mouse_down,
|
||||
on_mouse_move=self.controller.on_mouse_move,
|
||||
on_mouse_up=self.controller.on_mouse_up,
|
||||
@@ -100,7 +100,11 @@ class CatserApp:
|
||||
frame = self.controller.update(dt)
|
||||
|
||||
# 4. Update Layered Window Position & Pixels
|
||||
self.overlay.draw_frame(frame, self.controller.x, self.controller.y)
|
||||
self.overlay.draw_frame(
|
||||
frame,
|
||||
self.controller.x - self.config.pad_x,
|
||||
self.controller.y - self.config.pad_y,
|
||||
)
|
||||
|
||||
# 5. Check duration limit
|
||||
if max_seconds and (now - start_time >= max_seconds):
|
||||
|
||||
Reference in New Issue
Block a user