Skip to content

Move the font instances#23

Merged
kimkulling merged 1 commit intomainfrom
bugfix/move_fonts_to_context_issue-22
Mar 17, 2026
Merged

Move the font instances#23
kimkulling merged 1 commit intomainfrom
bugfix/move_fonts_to_context_issue-22

Conversation

@kimkulling
Copy link
Copy Markdown
Owner

@kimkulling kimkulling commented Mar 17, 2026

Summary by CodeRabbit

  • Refactor
    • Reorganized internal font handling structure with no user-visible changes to functionality or behavior.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 17, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e7f3a1a2-07ca-4d0c-b684-f54bd06caf7b

📥 Commits

Reviewing files that changed from the base of the PR and between acd302a and 3c4c813.

📒 Files selected for processing (3)
  • src/backends/sdl2_renderer.cpp
  • src/tinyui.h
  • src/widgets.cpp

Walkthrough

Refactors font member storage by relocating mDefaultFont and mSelectedFont pointers from the SDL-specific backend context to the main UI context. Updates all font references across the backend renderer, widget rendering, and header definitions to use the new pointer paths while maintaining equivalent behavior.

Changes

Cohort / File(s) Summary
Data Structure Refactoring
src/tinyui.h
Moves Font *mDefaultFont and Font *mSelectedFont members from SDLContext struct to Context struct, shifting font ownership from backend-specific to main UI context.
Backend Font Reference Updates
src/backends/sdl2_renderer.cpp
Updates all font operation calls in loadFont, loadDefaultFont, releaseRenderer, and drawText to reference ctx.mDefaultFont instead of ctx.mSDLContext.mDefaultFont.
Widget Font Reference Updates
src/widgets.cpp
Updates font references in Button, TreeView, and Label rendering paths to use ctx.mDefaultFont instead of the previous backend context path.
Build Configuration
CMakeLists.txt
Minor configuration adjustments (12 additions, 12 removals).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/move_fonts_to_context_issue-22
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can generate walkthrough in a markdown collapsible section to save space.

Enable the reviews.collapse_walkthrough setting to generate walkthrough in a markdown collapsible section.

@kimkulling kimkulling merged commit 26b49ab into main Mar 17, 2026
1 of 2 checks passed
@kimkulling kimkulling deleted the bugfix/move_fonts_to_context_issue-22 branch March 17, 2026 13:06
@sonarqubecloud
Copy link
Copy Markdown

@coderabbitai coderabbitai bot mentioned this pull request Mar 18, 2026
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.

Font instances are part of the backend-rendercontext

2 participants