Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

align-border not fully aligned on smaller pics #26

Open
eugenesvk opened this issue Jan 21, 2023 · 3 comments · May be fixed by #27
Open

align-border not fully aligned on smaller pics #26

eugenesvk opened this issue Jan 21, 2023 · 3 comments · May be fixed by #27

Comments

@eugenesvk
Copy link

I've noticed when viewing smaller pictures with 100% window size that they're not fully aligned to the window borders with your align-border commands due to it's limits of -3/3 on panning
Then I realized that there is a video-align-x command that does exactly that, so was wondering why you're using the panning command video-pan-x for alignment, a simple replacement seems to work and actually align to borders even for smaller pics?

@occivink
Copy link
Owner

You're right, and it looks like this property has existed for a long time too. The only problem that I can really see is that since there are multiple types of interaction to move the image provided by these scripts, it's best to use the same properties in all cases and not mix them up (same with pan-scan and zoom, you don't really want to combine both). And since video-pan- are the most flexible (except for the [-3..3]), that's what I ended up using in all commands.
If you're using mpv in a way that you only care about aligning the image, it might just be better to only use video-align-.

@eugenesvk
Copy link
Author

not mix them up

Interesting, I've found the interaction with video-align-x to be useful precisely due to this stupid -3 limit on panning: currently you can't push a small image past the window limits, but if you align to a border, then the whole "reference point" for the video-pan- shifts to the side where the border is at, so now you can do that! (weird API architecture for a simple "move the pic around" case)
Then, of course, you lose the ability to align perfectly to borders, need to pan the pic a bit (with constrained option not to overshoot again)

Also, I've noticed another issue with panning — you can't really be pixel-perfect there, sometimes you overshoot on multiple successive commands (so you can't move exactly by margin / vid_size, you might be 1 pixel off or even a hundred pixels off). Weirdly, if you move back and forth, it gets aligned just fine

So if that were fixed and the limit were lifted, then I guess it'd make sense to just use the panning and manualy check for the margin and stop when it reaches 0

@eugenesvk
Copy link
Author

For the last bug I've added (margin - 0.5) / vid_size and it seems to fix many of the 1pixel overshoots, but at the same time it doesn't help with bigger ones

@eugenesvk eugenesvk linked a pull request Jan 26, 2023 that will close this issue
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 a pull request may close this issue.

2 participants