Panning/zooming improvements and fixes, round 2#554
Conversation
- Never modify viewportSize outside of the added UpdateViewportSize() - Set a sane initial size in the construtor instead of haphazardly doing it in Render() - Ensure that the viewport and client sizes do not get out of sync in free size mode - Also update the size before positioning video when the tool changes (but see the added TODO)
The window zoom value was calculated incorrectly in free size mode when content zoom was active.
| // FitClientSizeToVideo fits the window to the video, which we don't want to do | ||
| GetGrandParent()->Layout(); | ||
| // TODO Is the following really necessary? Wouldn't it be taken care of by OnSizeEvent? | ||
| UpdateViewportSize(true); | ||
| PositionVideo(); |
There was a problem hiding this comment.
There is one remaining TODO: previously, this code called PositionVideo() without first updating the viewport size. This is either:
- broken, because the video will be positioned with the wrong
viewportSize, - or unnecessary, because the positioning has already been done or will later be redone by
OnSizeEvent().
I'm not sure which.
There was a problem hiding this comment.
And I don't know how to test this because for me, changing the tool never resizes the video.
This comment was marked as outdated.
This comment was marked as outdated.
|
Actually, it was because I overwrote my video scroll action settings by running an old version of Aegisub, sorry for the noise. |
- 新增UpdateViewportSize()统一视口大小管理与平移值缩放 - 平移坐标模型从视口高度比例改为绝对像素 - PositionVideo新增preserveContentSize参数 - 修复分离模式下缩放框值不正确的问题 - 修复分离模式下调整窗口时视频位置跳动 - 新增IsContentZoomActive()便利方法 - windowZoomValue计算移入PositionVideo统一管理
- 新增UpdateViewportSize()统一视口大小管理与平移值缩放 - 平移坐标模型从视口高度比例改为绝对像素 - PositionVideo新增preserveContentSize参数 - 修复分离模式下缩放框值不正确的问题 - 修复分离模式下调整窗口时视频位置跳动 - 新增IsContentZoomActive()便利方法 - windowZoomValue计算移入PositionVideo统一管理
|
Thanks - I'm finally getting to looking at this now. When I initially added panning, I was a bit hesitant to implement different resize behavior based on whether or not there is nonzero panning and zooming since I thought that would end up being unintuitive, but now that I try it with your PR it works pretty well. My only two notes are:
|
A few additional fixes that didn't make it into the first round:
Video comparison
before.webm
after.webm