Skip to content

Center pages vertically - #116

Merged
itsjunetime merged 1 commit into
itsjunetime:mainfrom
maxdexh:center-pages-vertically
Nov 24, 2025
Merged

Center pages vertically#116
itsjunetime merged 1 commit into
itsjunetime:mainfrom
maxdexh:center-pages-vertically

Conversation

@maxdexh

@maxdexh maxdexh commented Nov 24, 2025

Copy link
Copy Markdown
Collaborator

This PR applies logic similar to the current unused_width / 2-based horizontal centering to implement vertical centering.

My aim here was to improve how wide pages (such as slides with wider aspect ratios than the window) look in fullscreen (since they get stuck at the top of the area), but I found that I personally strongly prefer this look in general, so I am just creating this PR as-is.

This behavior would be very easy to make configurable if desired, simply by adding a condition around img_area.y += unused_height / 2.

@maxdexh
maxdexh force-pushed the center-pages-vertically branch from ee39177 to 51b50ba Compare November 24, 2025 21:27
@itsjunetime

Copy link
Copy Markdown
Owner

Yeah, this definitely looks much better. Thanks for adding it!

@itsjunetime
itsjunetime merged commit b7d1b78 into itsjunetime:main Nov 24, 2025
1 check passed
@itsjunetime

Copy link
Copy Markdown
Owner

Also, I couldn't help but notice the shell.nix from the previous commit - I don't use nix for development myself, but I understand its usefulness, so I wouldn't mind adding it to the repo if you would like. I'm fine either way, though.

@maxdexh

maxdexh commented Nov 24, 2025

Copy link
Copy Markdown
Collaborator Author

One day I will learn not to commit these on accident ;)

I'm also fine either way, I just copied the build inputs from the tdf package spec in nixpkgs because I was getting build errors.

@maxdexh
maxdexh deleted the center-pages-vertically branch November 24, 2025 22:05
@maxdexh

maxdexh commented Nov 24, 2025

Copy link
Copy Markdown
Collaborator Author

Idk if you care about typos, I just noticed I misspelled "sporadically" in my code comment.

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