-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
…tches Resize the window to the physical size of the image. If softbuffer scales the contents incorrectly, only parts of the fruit basket will be visible.
Currently the size of the buffer on macOS is interpreted in logical pixels, which is inconsistent with the other platforms. Instead, we should apply the same scale factor that applies to regular rendering.
Continuation of rust-windowing/softbuffer#32 here :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can attest that this change improves the current situation
layer.set_contents_gravity(ContentsGravity::TopLeft); | ||
layer.set_needs_display_on_bounds_change(false); | ||
layer.set_contents_scale(window.backingScaleFactor()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure if this will always be correct, e.g. if the view is moved to another monitor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this won't update automatically if the window's backing scale factor changes dynamically :(. I haven't looked into doing that, but agree that it would make sense to do, generally. I'd prefer it separate from this PR, as the lack of any scaling right now is pretty bad as-is :)
Thanks for checking and reviewing - much appreciated. |
No problem - thank you! ;) |
BTW, do you folks have any plans on making a new release in the near future? I'd like to switch Slint over to use swbuf instead of softbuffer. |
So yeah, probably a new release soon, if nothing else I'd except it some time in the start of the new year. |
Currently the size of the buffer on macOS is interpreted in logical pixels, which
is inconsistent with the other platforms. Instead,
we should apply the same scale factor that applies to regular rendering.