fix: drill card thumbnail aspect ratio, ice canvas syntax error, and logo loading #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/drill-thumbnail-and-logo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes two reported issues: drill card thumbnails showing distorted ice surfaces, and the center ice logo not rendering (showing tiny fallback text instead).
Changes
Fix 1:
js/ice_canvas.js— Syntax error indrawRinkBorderRoot cause: Invalid double-
elseblock (} else { ... } else { ... }) caused a JavaScript parse error, preventingIceCanvasRendererfrom being defined. This broke the drill designer and any view using the JS renderer.Fix: Changed
else if (half-ice-lengthwise) ... else { center } else { full }to properelse if (half-ice-lengthwise) ... else if (center) ... else { full }chain.Fix 2:
views/drills_library.php— Aspect ratio distortion in drill thumbnailsRoot cause:
ctx.drawImage(rinkImg, 0, 0, w, h)stretched the 200:85 aspect ratio rink image to fill the 3:2 canvas, distorting the ice surface.Fix: Added
object-fit: containlogic — calculates proper draw dimensions that maintain the rink's aspect ratio and centers it within the canvas.Fix 3:
generate_rink_images.php— Logo loading fails silentlyRoot cause:
loadLogoImage()relied solely onfile_get_contents()which may fail for RustFS URLs (disabledallow_url_fopen, network issues, etc.). When it fails, the fallback text "ARCTIC WOLVES HOCKEY" is drawn instead — which appears as tiny text when the 7680px image is scaled to thumbnails.Fix: Added cURL as a fallback method when
file_get_contents()fails.Fix 4:
js/ice_canvas.js— Logo opacity too lowRoot cause: The center ice logo was drawn at 12% opacity (
ctx.globalAlpha = 0.12), making it barely visible even when loaded successfully.Fix: Increased logo image opacity to 25% while keeping fallback text at 12%.
Branch
fix/drill-thumbnail-and-logo→mainAfter merge, rink images should be regenerated (
php generate_rink_images.php?regenerate=1) to bake in the logo with the new loading method.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.