Feature/windows screenshot feature improve#11
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the Windows region screenshot feature by moving its implementation out of src/binding_windows.cpp and introducing an automated SVG-to-C header generation script (scripts/gen-icons.js) to compile toolbar icons directly into the binary. It also adds several SVG assets and the nanosvgrast.h third-party library for SVG rasterization. Feedback on the changes points out that the toCLiteral function in scripts/gen-icons.js is defined but never used, suggesting its removal to clean up dead code.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| // C 字符串字面量转义:处理 " \ 和换行 | ||
| function toCLiteral(str) { | ||
| // 把字符串按行拆开,每行用独立字面量拼接,保证可读性且避免超长行 | ||
| return str | ||
| .replace(/\\/g, '\\\\') | ||
| .replace(/"/g, '\\"') | ||
| .split(/\r?\n/) | ||
| .map((line) => ` "${line}"`) | ||
| .join('\n'); | ||
| } |
- 非文字标注支持选中、拖拽、缩放(四角手柄),箭头标注新增起点/终点端点独立手柄 - 箭头几何改为机翼状(底边内凹、两翼后掠),锥形箭身避免抗锯齿拼接缝隙 - 选中标注时工具栏回显对应工具并高亮 - 性能优化:GDI+ 会话级单次 Startup/Shutdown,复用 FontFamily/StringFormat/Font - 性能优化:局部刷新脏矩形、文字测量缓存、固定样式 Pen/Brush 缓存,减少每帧重绘开销 - 新增拖拽用 drag.svg 资源
Windows 平台截图预处理工具栏 — 实现了完整的截图后编辑功能,支持: