Repository navigation
Conversation
Replace the single "SVG" button in the ER toolbar with an "Export" dropdown offering SVG (vector), PNG (2x, transparent) and JPG (2x, white background). - er.js: extract buildExportSvg()/triggerDownload() so all three formats share one content-fitted SVG; add exportERImage(format) which rasterizes it via <img> + canvas at 2x - index.html: showERExportMenu()/closeERExportMenu() reusing the existing .export-dropdown styles, mutually exclusive with the SQL export dropdown - vscode-extension: bump to 0.1.2, update CHANGELOG/README, repackage .vsix (replaces the stale 0.0.1 artifact)
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.
改动概述
ER Diagram 此前仅支持导出 SVG。本次将工具栏的
SVG按钮改为Export下拉菜单,新增 PNG、JPG 两种位图导出格式,并同步升级 VS Code 扩展版本至0.1.2。主要变更
buildExportSvg()与triggerDownload(),三种格式共用同一份「按内容自适应裁剪 + 30px 留白」的独立 SVG,避免重复实现。exportERImage(format),通过<img>+<canvas>以 2x 倍率栅格化;PNG 保留透明背景,JPG 因无 alpha 通道先填充白底并以 0.92 质量编码。URL.revokeObjectURL延后释放以兼容下载触发;补充img.onerror、空画布、toBlob返回空等分支的 toast 提示。showERExportMenu()/closeERExportMenu(),复用既有.export-dropdown样式,并与 SQL 导出下拉菜单互斥。0.1.1→0.1.2,更新 CHANGELOG 与 README,重新打包.vsix(替换此前遗留的0.0.1产物)。关键文件
shield-plugin-postgres/static/er.jsbuildExportSvg/triggerDownload/exportERImageshield-plugin-postgres/static/index.htmlExport下拉菜单与工具栏按钮shield-plugin-postgres/vscode-extension/package.jsonshield-plugin-postgres/vscode-extension/CHANGELOG.md/README.mdshield-plugin-postgres/vscode-extension/shield-postgresql-0.1.2.vsix验证方式
cd shield-plugin-postgres && go build -ldflags="-s -w" -o shield-plugin-postgres .Export,分别导出 SVG / PNG / JPG:Nothing to export。Export与SQL两个下拉菜单互斥,点击空白处可关闭。