fix: 对话框整体等比缩放(背景与文字同尺寸,不再溢出);dist 不再携带授权算法说明
- 对话框缩放改用「放大 SizedBox + FittedBox」,布局与绘制同步放大,背景与内容同尺寸 (修复 100% 显示比例大屏下文字超出弹窗背景的问题) - 安全:构建只复制 license/*.lic 到 dist,绝不打包任何说明文档 - 算法说明从 license/README.md 移到仅仓库可见的 docs/LICENSE-GUIDE.md - 移除 dist 中已误打包的 README;license/ 仅保留 .gitkeep;重新构建 dist
This commit is contained in:
+13
-6
@@ -30,15 +30,22 @@ double dialogScale(BuildContext context) {
|
|||||||
return k.clamp(1.0, 1.75);
|
return k.clamp(1.0, 1.75);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 按 [dialogScale] 对固定尺寸的对话框内容做等比缩放(仅放大,不缩小)。
|
/// 按 [dialogScale] 等比缩放固定尺寸的对话框内容(**含背景与文字**)。
|
||||||
///
|
///
|
||||||
/// 使用 [Transform.scale] 只影响绘制与命中,不改变布局尺寸,因此
|
/// 关键:用「放大后的 SizedBox 包裹 + [FittedBox]」而不是单纯 [Transform.scale]。
|
||||||
/// 对话框仍以原尺寸居中,视觉上整体放大。
|
/// 前者同时放大**布局尺寸与绘制**,因此对话框背景与文字始终同尺寸、不会溢出;
|
||||||
|
/// 后者只放大绘制、背景不变,导致 100% 显示比例的大屏上文字超出背景边缘。
|
||||||
Widget scaledDialogBox(BuildContext context, double width, double height, Widget child) {
|
Widget scaledDialogBox(BuildContext context, double width, double height, Widget child) {
|
||||||
final double k = dialogScale(context);
|
final double k = dialogScale(context);
|
||||||
final Widget box = SizedBox(width: width, height: height, child: child);
|
if (k <= 1.0001) return SizedBox(width: width, height: height, child: child);
|
||||||
if (k <= 1.0001) return box;
|
return SizedBox(
|
||||||
return Transform.scale(scale: k, alignment: Alignment.center, child: box);
|
width: width * k,
|
||||||
|
height: height * k,
|
||||||
|
child: FittedBox(
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
child: SizedBox(width: width, height: height, child: child),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===================== 通用提示 =====================
|
// ===================== 通用提示 =====================
|
||||||
|
|||||||
+4
-2
@@ -31,8 +31,10 @@ if exist dist rmdir /s /q dist
|
|||||||
mkdir dist
|
mkdir dist
|
||||||
xcopy /e /i /y /q "build\windows\x64\runner\Release\*" "dist\" >nul
|
xcopy /e /i /y /q "build\windows\x64\runner\Release\*" "dist\" >nul
|
||||||
|
|
||||||
rem Copy the license folder (so .lic files live next to the exe).
|
rem Create an empty license folder next to the exe and copy ONLY *.lic files.
|
||||||
if exist license xcopy /e /i /y /q "license\*" "dist\license\" >nul
|
rem IMPORTANT: never ship any documentation (the algorithm must stay private).
|
||||||
|
if not exist "dist\license" mkdir "dist\license"
|
||||||
|
if exist "license\*.lic" xcopy /y /q "license\*.lic" "dist\license\" >nul
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo Build OK: dist\sequence_diagram.exe
|
echo Build OK: dist\sequence_diagram.exe
|
||||||
|
|||||||
Reference in New Issue
Block a user