Conversation
… implementation - Convert text-based table to Markdown table in DPI scaling documentation - Clarify rem-based CSS + dynamic font-size implementation strategy - Update code examples with new scaling formula (min 0.75 factor) - Document compatibility with IE 9+ and Ctrl+Wheel fine-tuning - Refactor HTA CSS to use rem units for cross-resolution DPI awareness - Update JavaScript to apply dynamic root font-size scaling
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ✏️ Tip: You can disable in-progress messages and the fortune message in your review settings. Tip You can disable sequence diagrams in the walkthrough.Disable the ✨ 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 |
Walkthrough该PR将DPI缩放策略从模拟/变换/缩放方案改为基于rem的统一方案,引入单一的scaleFactor(基于屏幕宽度)驱动动态根字体大小,并相应更新文档、样式和JavaScript逻辑。 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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 |
🤖 Augment PR SummarySummary: Refactors the installer’s DPI scaling to use rem-based CSS with a dynamically adjusted root font-size, and updates the DPI scaling documentation for clarity. Changes:
Technical Notes: Designed to keep IE=edge/HTA compatibility while retaining Ctrl+Wheel zoom as an optional fine-tuning mechanism. 🤖 Was this summary useful? React with 👍 or 👎 |
| var scaleFactor = Math.max(0.75, screen.width / 1920); | ||
|
|
||
| // 设置 rem 基准字号:CSS 全部使用 rem 单位,随此值等比缩放 | ||
| var rootFontSize = Math.max(10, Math.round(14 * scaleFactor)); |
There was a problem hiding this comment.
rootFontSize is rounded (Math.round(14 * scaleFactor)), so the effective CSS scale becomes rootFontSize/14 and can diverge from scaleFactor (e.g., 1.333 → 19px ≈ 1.357). This means the claim that window and CSS “scale together by the same factor” may not hold exactly and could cause small layout proportionality drift.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| | --- | --- | --- | --- | --- | --- | --- | | ||
| | 1080p | 100% | 1920 | 1.000 | 14px | 860×720 | 860×720 | | ||
| | 1080p | 125% | 1536 | 0.800 | 11px | 688×576 | 860×720 | | ||
| | 1080p | 150% | 1280 | 0.750 | 11px | 645×540 | 968×810 | |
There was a problem hiding this comment.
In this scaling table, scale=0.750 but font=11px, which corresponds to ~0.786× of the 14px base due to rounding. It may be worth clarifying in the docs that font/window scaling is approximate when fontSize is rounded to whole pixels.
Severity: low
Other Locations
docs/dpi-scaling-impl.md:120docs/dpi-scaling-impl.md:122
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
What
Refactor DPI scaling implementation to use rem-based CSS with dynamic font-size adjustment,
and convert the scaling examples table to Markdown format for better documentation clarity.
Why
The previous approach had layout overflow and maintenance issues. The rem-based solution
leverages \screen.width\ (logical resolution) to uniformly scale both window size and CSS
content, providing consistent DPI-awareness across all resolution DPI combinations without
requiring multiple CSS files or hardcoded breakpoints.
How
Testing
Summary by CodeRabbit
改进