Skip to content

Commit 25aa59b

Browse files
committed
fix(layout): 移除未使用的分页逻辑,简化布局计算
- 在 SNLayoutBuilder 中删除未启用分页的逻辑,确保页面尺寸计算更为清晰。 - 更新 SimpleNotation 类,移除多余的空行,提升代码整洁性。 该变更优化了布局构建器的逻辑,增强了代码的可读性和维护性。
1 parent f239943 commit 25aa59b

2 files changed

Lines changed: 0 additions & 6 deletions

File tree

packages/simple-notation/src/layout/builder.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ export class SNLayoutBuilder {
8181
// 启用分页:使用页面尺寸
8282
effectiveWidth = pageConfig.size.width;
8383
effectiveHeight = pageConfig.size.height;
84-
} else {
85-
// 未启用分页:页面尺寸 = 画布尺寸
86-
// 如果画布未指定,使用页面默认尺寸作为参考
87-
effectiveWidth = canvasWidth ?? pageConfig.size.width;
88-
effectiveHeight = canvasHeight ?? pageConfig.size.height;
8984
}
9085

9186
// 设置根节点的布局属性

packages/simple-notation/src/sn.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ export class SimpleNotation {
133133
if (!this.mounted) {
134134
throw new Error('SimpleNotation instance is not mounted');
135135
}
136-
137136
try {
138137
// 1. 解析数据
139138
const parseResult = this.dataManager.processData(data, type);

0 commit comments

Comments
 (0)