feat: zoom the live camera view with the mouse wheel (#11322)#11325
Open
BenJule wants to merge 1 commit into
Open
feat: zoom the live camera view with the mouse wheel (#11322)#11325BenJule wants to merge 1 commit into
BenJule wants to merge 1 commit into
Conversation
The device tab's live video could not be zoomed, unlike Bambu Handy. Add mouse-wheel digital zoom (1x fit up to 5x, centred) to wxMediaCtrl3, which already paints each decoded frame itself. The paint path now applies a zoom factor on top of the existing contain-fit scale; at 1x the rendering is identical to before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #11322. The live camera view in the device tab couldn't be zoomed, unlike the pinch-zoom in Bambu Handy. This adds mouse-wheel digital zoom to the live view (1x fit up to 5x, centred on the view).
wxMediaCtrl3already paints each decoded frame itself (wxPaintDC+DrawBitmap), so this is a client-side change: a zoom factor is applied on top of the existing contain-fit scale, and the image is re-centred (cropped to the window when zoomed in).Implementation
wxMediaCtrl3.h: adouble m_zoommember and amouseWheelEventhandler.wxMediaCtrl3.cpp: bindwxEVT_MOUSEWHEEL, adjust/clamp the zoom andRefresh(); the paint path multiplies the fit scale by the zoom and re-centres.Test plan
m_zoom == 1reproduces the existing centring exactly (I don't have a GUI build here to capture a recording). A maintainer build is the way to confirm the feel; the step/limits (1.1x per notch, 1x–5x) are easy to tune if you'd prefer different values, and I can add cursor-anchored zoom instead of centre-anchored if that's preferred.