Skip to content

Use half pixels and inverse color by default for thin border + ghostty workaround for ♥ vs ❤#112

Merged
ldemailly merged 5 commits intomainfrom
better_border
Apr 26, 2025
Merged

Use half pixels and inverse color by default for thin border + ghostty workaround for ♥ vs ❤#112
ldemailly merged 5 commits intomainfrom
better_border

Conversation

@ldemailly
Copy link
Copy Markdown
Member

@ldemailly ldemailly commented Apr 26, 2025

@ldemailly ldemailly changed the title Use half pixels and inverse color by default for thin border Use half pixels and inverse color by default for thin border + ghostty workaround for ♥ vs ❤ Apr 26, 2025
@ldemailly ldemailly requested a review from Copilot April 26, 2025 20:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the blackjack game’s border styling and fixes a suit rendering issue by introducing a global Heart variable and new border-related flags while also improving the half pixel drawing behavior via ansipixels.

  • Updated tests and game logic to use a global Heart variable instead of the hard-coded "♥".
  • Introduced new border customization flags (--no-border, --wide) and additional border color/background settings.
  • Modified ansipixels drawing routines to leverage half pixels and inverse colors for improved visual appearance.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
blackjack/blackjack_test.go Tests updated to use the global Heart variable for suit representation instead of literals.
blackjack/blackjack.go Added new border customization fields/flags and workaround for the ♥ vs ❤ issue.
blackjack/README.md Updated usage instructions to reflect the new version and additional border flags.
ansipixels/codes.go Introduced an Inverse constant for inverse colors in drawing operations.
ansipixels/ansipixels.go Revised drawing functions to support half pixel rendering and updated box border patterns.
Comments suppressed due to low confidence (4)

blackjack/blackjack.go:382

  • [nitpick] The green flag’s description was updated to mention replacing black borders; verify that the description accurately reflects the new behavior.
greenFlag := flag.Bool("green", false, "Use green instead of black around the cards")

blackjack/blackjack.go:386

  • Reassigning the global Heart variable based on the TERM environment may produce unexpected side effects in different contexts; consider isolating this behavior or using dependency injection to avoid potential test or concurrency issues.
if os.Getenv("TERM") == "xterm-ghostty" {

ansipixels/ansipixels.go:392

  • Verify that replacing the original SquareBottomRight with 'Horizontal' for the bottom border in DrawSquareBox is intentional for the new design.
ap.DrawBox(x, y, w, h, SquareTopLeft, Horizontal, SquareTopRight, Vertical, SquareBottomLeft, Horizontal, SquareBottomRight, false)

ansipixels/ansipixels.go:396

  • Ensure that updating the bottom border in DrawRoundBox to use 'Horizontal' instead of RoundBottomRight aligns with the intended visual changes.
ap.DrawBox(x, y, w, h, RoundTopLeft, Horizontal, RoundTopRight, Vertical, RoundBottomLeft, Horizontal, RoundBottomRight, false)

@ldemailly ldemailly merged commit 22c9b41 into main Apr 26, 2025
10 checks passed
@ldemailly ldemailly deleted the better_border branch April 26, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants