Fix end table clipping in tutorial overlay#184
Conversation
Moved end_table.png and sprite_sheet.png to the drawable-nodpi folder. This prevents Android from automatically scaling these bitmaps based on screen density, ensuring that the pixel-based coordinates used for rendering on the Canvas (e.g. in TutorialOverlay and GameBoard) match the actual dimensions of the loaded bitmaps. Co-authored-by: candour <4670475+candour@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (2)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
The issue was caused by Android's automatic density scaling. When assets are placed in the default
drawable/folder, they are assumed to bemdpi(160dpi). On higher-density devices, Android scales them up automatically. Since the code inTutorialOverlay.ktandGameBoard.ktuses hardcoded pixel dimensions fromSpriteConstants.ktto crop and draw these sprites, the scaling caused the coordinates to point to the wrong parts of the (now larger) bitmap, resulting in clipping or incorrect rendering.Moving these assets to
drawable-nodpi/ensures they are loaded at their original resolution regardless of device density, which is standard practice for game assets intended for manual canvas drawing.PR created automatically by Jules for task 9663305868862948666 started by @candour