fix(stream): use measured viewport for pip sizing#50
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
Changes视频视口尺寸缓存与 XComponent 计算优先策略
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@entry/src/main/ets/pages/StreamPage.ets`:
- Around line 1253-1256: The code updates displayInfo.screenWidth and
screenHeight when viewportSize is available, but fails to synchronize the
panZoomHandler parent container size, which causes touch coordinate offset
issues during scaling interactions. After updating the displayInfo dimensions in
the if block (where viewportSize is checked), also call
panZoomHandler.setParentSize() with the same width and height values. Apply this
same synchronization fix to all locations where displayInfo screen dimensions
are updated, including the section referenced at lines 1259-1265.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: aed9c4ce-4aad-4e4a-867f-751af505006d
📒 Files selected for processing (1)
entry/src/main/ets/pages/StreamPage.ets
改了啥呀
为啥要改
用户反馈画中画里“画面居中了但是裁切,没有缩放”。之前修复主要依赖 window/drawableRect,在 PiP 这种系统容器里可能仍然拿到偏大的窗口尺寸。ArkUI 的
onAreaChange才是当前页面真实可绘制区域,用它做 XComponent 等比适配更贴近实际布局。验证
git diff --check -- entry/src/main/ets/pages/StreamPage.etsNODE_PATH=/Users/mac/Program/moonlight-harmony/node_modules DEVECO_SDK_HOME=/Users/mac/ohos-sdk-cache/6.1-Release-mac/sdk-ci-shape node /Applications/DevEco-Studio.app/Contents/tools/hvigor/hvigor/bin/hvigor.js --no-daemon --mode module -p module=entry assembleHap:nativelib:default@BuildNativeWithCmake,缓存 SDK 的clang++链接阶段走到 macOSld64.lld,不识别 OHOS linker 参数(如--build-id=sha1、--no-undefined、-z)。需要测试和回归
stretchVideo开启时:仍应按设置填满容器,不被本次 measured viewport 逻辑破坏。Summary by CodeRabbit
优化与修复
Bug Fixes
Performance