-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
feat(composer): focus picker #1101
Conversation
fix: default to center
useful for bindings, so we don't have to call re-draw manually
This reverts commit ed3f9f9.
@rmader is there something broken with the focus picker? (curious about the above revert 😅) |
Hehe, well spotted :P And sorry for the noise, should have removed the commit message. Something in the patch breaks for me on Fedora 40 (with gtk+libadwaita from git) - I assume some vala bug or so. I've switched to Fedora 41 now and here everything builds fine. |
No worries about the noise! I assume it was the AudioVisualizer's adw 1.6 accent colors, I guess-worked how the binding should look like on release but I was wrong (actually I'm right and the bindings are incomplete but I'm not going to argue ( |
The focus picker
Mastodon allows you to pick the thumbnail focus of your attachments. It's based on https://github.com/jonom/jquery-focuspoint#1-calculate-your-images-focus-point
The focus point is communicated in the form of coordinates:
(0,0) being the center of the image, (1,1) the top right corner and (-1,-1) the bottom left one
The FocusPicker widget is responsible for displaying an image and moving the picker but also for calculating this mess.
API coordinates <=> width, height coordinates
The width,height coordinates have to be recalculated when the window gets resized (etc) so it stays in place as the image also gets resized
Mastodon also does this thing where you can focus outside of the image - even though the actual coordinates are image size based, as seen in its preview:
Enough talk, demo:
Screencast.from.2024-09-06.06-11-00.mp4
Notice how it stays in position between resizing, plus it stays in the limits of the image
TODO:
fix: #173