refactor: sizing
This commit is contained in:
@@ -178,7 +178,19 @@ export function calculateSinglePageLayout(options: LayoutOptions): SinglePageLay
|
||||
a4Height,
|
||||
cardsPerRow,
|
||||
rowsPerPage,
|
||||
cardsPerPage
|
||||
cardsPerPage,
|
||||
frameBounds: {
|
||||
minX: offsetX,
|
||||
minY: offsetY,
|
||||
maxX: offsetX + maxGridWidth,
|
||||
maxY: offsetY + maxGridHeight
|
||||
},
|
||||
frameBoundsWithMargin: {
|
||||
x: offsetX - 1,
|
||||
y: offsetY - 1,
|
||||
width: maxGridWidth + 2,
|
||||
height: maxGridHeight + 2
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
/**
|
||||
* 边界框
|
||||
*/
|
||||
export interface Bounds {
|
||||
minX: number;
|
||||
minY: number;
|
||||
maxX: number;
|
||||
maxY: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 带边距的边界框(用于裁切标记)
|
||||
*/
|
||||
export interface BoundsWithMargin {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 卡片形状类型
|
||||
*/
|
||||
@@ -53,6 +73,10 @@ export interface SinglePageLayout {
|
||||
rowsPerPage: number;
|
||||
/** 每页总卡片数 */
|
||||
cardsPerPage: number;
|
||||
/** 排版区域边界框 */
|
||||
frameBounds: Bounds;
|
||||
/** 带边距的边界框(用于裁切标记) */
|
||||
frameBoundsWithMargin: BoundsWithMargin;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user