File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
app/src/core/service/dataGenerateService/stageExportEngine Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ export namespace StageExportPng {
1818 */
1919 let cameraScaleWhenExport = 0.5 ;
2020
21+ const PADDING = 100 ;
22+
2123 export function changeCameraScaleWhenExport ( scale : number ) {
2224 cameraScaleWhenExport = scale ;
2325 }
@@ -39,8 +41,8 @@ export namespace StageExportPng {
3941 // 创建完毕
4042
4143 const stageRect = StageManager . getBoundingRectangle ( ) ;
42- const topLeft = stageRect . leftTop ;
43- const bottomRight = stageRect . rightBottom ;
44+ const topLeft = stageRect . leftTop . subtract ( new Vector ( PADDING , PADDING ) ) ;
45+ const bottomRight = stageRect . rightBottom . add ( new Vector ( PADDING , PADDING ) ) ;
4446 // 开始把画布内容渲染到新画布上
4547 Camera . targetScale = cameraScaleWhenExport ;
4648 Camera . currentScale = cameraScaleWhenExport ;
@@ -144,7 +146,7 @@ export namespace StageExportPng {
144146 resultCanvas . style . zIndex = "99999" ;
145147 resultCanvas . style . pointerEvents = "none" ;
146148
147- const stageSize = StageManager . getSize ( ) ;
149+ const stageSize = StageManager . getSize ( ) . add ( new Vector ( PADDING * 2 , PADDING * 2 ) ) ;
148150 // 设置大小
149151 resultCanvas . width = stageSize . x * SCALE * cameraScaleWhenExport ;
150152 resultCanvas . height = stageSize . y * SCALE * cameraScaleWhenExport ;
You can’t perform that action at this time.
0 commit comments