@yft-design/engine 0.0.17 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -11
- package/dist/EngineCanvas.d.ts +0 -255
- package/dist/core/color.d.ts +0 -11
- package/dist/core/distanceField.d.ts +0 -13
- package/dist/core/events.d.ts +0 -25
- package/dist/core/gradient.d.ts +0 -47
- package/dist/core/homography.d.ts +0 -20
- package/dist/core/imageFilters.d.ts +0 -31
- package/dist/core/mat2d.d.ts +0 -62
- package/dist/core/pathData.d.ts +0 -36
- package/dist/core/pattern.d.ts +0 -14
- package/dist/core/point.d.ts +0 -14
- package/dist/core/psdEffects.d.ts +0 -48
- package/dist/core/roundedRect.d.ts +0 -48
- package/dist/core/shadow.d.ts +0 -23
- package/dist/core/snap.d.ts +0 -103
- package/dist/core/stroke.d.ts +0 -13
- package/dist/core/triangulate.d.ts +0 -31
- package/dist/core/warpMesh.d.ts +0 -38
- package/dist/debug/canvasInspection.d.ts +0 -20
- package/dist/debug/pixelDiff.d.ts +0 -7
- package/dist/debug/pixelDiff.js +1 -64
- package/dist/debug/seed.d.ts +0 -426
- package/dist/debug/seed.js +28 -3806
- package/dist/decoders/webp2sprite.d.ts +0 -16
- package/dist/engineFlag.d.ts +0 -76
- package/dist/export/SceneExporter.d.ts +0 -58
- package/dist/export/glExport.d.ts +0 -41
- package/dist/export/svgExport.d.ts +0 -181
- package/dist/index.d.ts +1 -14
- package/dist/index.js +1060 -64
- package/dist/interact/animationPlayback.d.ts +0 -62
- package/dist/interact/canvasInteractions.d.ts +1 -38
- package/dist/interact/cropSession.d.ts +0 -68
- package/dist/interact/dblClick.d.ts +0 -32
- package/dist/interact/expandSession.d.ts +0 -46
- package/dist/interact/hotkeyActions.d.ts +0 -12
- package/dist/interact/pageTransfer.d.ts +0 -2
- package/dist/interact/pathSession.d.ts +0 -42
- package/dist/interact/pointer.d.ts +0 -87
- package/dist/interact/pointerTablePuzzle.d.ts +0 -60
- package/dist/interact/pointerTransform.d.ts +0 -48
- package/dist/interact/pointerTypes.d.ts +6 -148
- package/dist/interact/snapGuide.d.ts +0 -68
- package/dist/interact/tableCellEditing.d.ts +0 -34
- package/dist/interact/tableInteraction.d.ts +0 -31
- package/dist/interact/textEditing.d.ts +0 -44
- package/dist/interact/warpFacade.d.ts +0 -5
- package/dist/interact/warpSession.d.ts +0 -55
- package/dist/interact/wheelScroll.d.ts +0 -42
- package/dist/model/alphaHit.d.ts +0 -51
- package/dist/model/animation.d.ts +0 -99
- package/dist/model/arcLayout.d.ts +0 -33
- package/dist/model/arcTextTransform.d.ts +0 -4
- package/dist/model/compatEvents.d.ts +0 -72
- package/dist/model/compatObject.d.ts +0 -360
- package/dist/model/cropEdit.d.ts +0 -60
- package/dist/model/document.d.ts +0 -167
- package/dist/model/elementTypes.d.ts +0 -47
- package/dist/model/expandEdit.d.ts +0 -36
- package/dist/model/fabricPrimitives.d.ts +0 -24
- package/dist/model/filler.d.ts +0 -12
- package/dist/model/groupAssemble.d.ts +0 -5
- package/dist/model/groupChildMove.d.ts +0 -37
- package/dist/model/groupResize.d.ts +0 -42
- package/dist/model/handles.d.ts +0 -24
- package/dist/model/imageMaskBake.d.ts +0 -50
- package/dist/model/lineConstruct.d.ts +0 -8
- package/dist/model/maskCropEdit.d.ts +0 -34
- package/dist/model/pathBackground.d.ts +0 -33
- package/dist/model/pathConstruct.d.ts +0 -24
- package/dist/model/pathEdit.d.ts +0 -55
- package/dist/model/puzzleEdit.d.ts +0 -66
- package/dist/model/puzzleLayout.d.ts +0 -31
- package/dist/model/scene.d.ts +0 -603
- package/dist/model/schema.d.ts +0 -48
- package/dist/model/shapePath.d.ts +0 -5
- package/dist/model/smartObjectBake.d.ts +0 -6
- package/dist/model/tableEdit.d.ts +0 -90
- package/dist/model/tableFacade.d.ts +0 -5
- package/dist/model/tableLayout.d.ts +0 -40
- package/dist/model/textAlign.d.ts +0 -22
- package/dist/model/textLayout.d.ts +0 -213
- package/dist/render/GLBlend.d.ts +0 -24
- package/dist/render/GLContext.d.ts +0 -11
- package/dist/render/GLIsolate.d.ts +0 -25
- package/dist/render/GLTextureCache.d.ts +0 -72
- package/dist/render/GlyphAtlas.d.ts +0 -98
- package/dist/render/MeshBatch.d.ts +0 -71
- package/dist/render/QuadBatch.d.ts +0 -87
- package/dist/render/SceneRenderer.d.ts +0 -137
- package/dist/render/SourceManager.d.ts +0 -82
- package/dist/render/TextRenderer.d.ts +0 -120
- package/dist/render/arcText.d.ts +0 -28
- package/dist/render/bakeGate.d.ts +0 -35
- package/dist/render/batchOrder.d.ts +0 -60
- package/dist/render/blendMode.d.ts +0 -27
- package/dist/render/clipMaskPainter.d.ts +0 -42
- package/dist/render/fontInvalidation.d.ts +0 -18
- package/dist/render/fontInvalidationController.d.ts +0 -52
- package/dist/render/frameOverlay.d.ts +0 -32
- package/dist/render/framePipeline.d.ts +0 -27
- package/dist/render/gpuFilterPasses.d.ts +0 -15
- package/dist/render/gpuFx.d.ts +0 -82
- package/dist/render/gpuImageFilters.d.ts +0 -41
- package/dist/render/gpuShadow.d.ts +0 -38
- package/dist/render/gradientRamp.d.ts +0 -14
- package/dist/render/imageEffects.d.ts +0 -99
- package/dist/render/lineDecorationSdf.d.ts +0 -32
- package/dist/render/maskRender.d.ts +0 -60
- package/dist/render/multiPage.d.ts +0 -91
- package/dist/render/progressiveLoad.d.ts +0 -27
- package/dist/render/psdEffectPainter.d.ts +0 -25
- package/dist/render/psdWarpText.d.ts +0 -19
- package/dist/render/puzzleClamp.d.ts +0 -15
- package/dist/render/renderEpoch.d.ts +0 -21
- package/dist/render/retainedFrame.d.ts +0 -36
- package/dist/render/ruler.d.ts +0 -36
- package/dist/render/screenClip.d.ts +0 -31
- package/dist/render/scrollText.d.ts +0 -46
- package/dist/render/segmentTable.d.ts +0 -30
- package/dist/render/selectionOverlay.d.ts +0 -203
- package/dist/render/settleScheduler.d.ts +0 -24
- package/dist/render/shaders.d.ts +4 -24
- package/dist/render/shadowBake.d.ts +0 -28
- package/dist/render/shadowPainter.d.ts +0 -8
- package/dist/render/sharedGpuPainters.d.ts +0 -13
- package/dist/render/sourceHydration.d.ts +0 -8
- package/dist/render/strokeBake.d.ts +0 -59
- package/dist/render/strokeMiterOutline.d.ts +0 -29
- package/dist/render/strokePainter.d.ts +0 -31
- package/dist/render/strokeSdf.d.ts +0 -52
- package/dist/render/svgRaster.d.ts +0 -34
- package/dist/render/tableOverlay.d.ts +0 -35
- package/dist/render/textHighlight.d.ts +0 -67
- package/dist/render/textureUpload.d.ts +0 -13
- package/dist/render/verticalText.d.ts +0 -21
- package/dist/render/warpText.d.ts +0 -48
- package/dist/render/workspaceBackdrop.d.ts +0 -22
- package/dist/render/workspaceChecker.d.ts +0 -34
- package/dist/render/workspaceGlow.d.ts +0 -38
- package/package.json +4 -3
- package/dist/EngineCanvas.js +0 -1202
- package/dist/core/canvasPerf.js +0 -170
- package/dist/core/color.js +0 -107
- package/dist/core/distanceField.js +0 -92
- package/dist/core/events.js +0 -80
- package/dist/core/gradient.js +0 -175
- package/dist/core/homography.js +0 -123
- package/dist/core/imageFilters.js +0 -330
- package/dist/core/mat2d.js +0 -241
- package/dist/core/pathData.js +0 -926
- package/dist/core/pattern.js +0 -40
- package/dist/core/point.js +0 -119
- package/dist/core/psdEffects.js +0 -158
- package/dist/core/roundedRect.js +0 -164
- package/dist/core/shadow.js +0 -47
- package/dist/core/snap.js +0 -793
- package/dist/core/stroke.js +0 -45
- package/dist/core/triangulate.js +0 -194
- package/dist/core/warpMesh.js +0 -469
- package/dist/debug/canvasInspection.js +0 -113
- package/dist/decoders/gif2sprite.js +0 -84
- package/dist/decoders/webp2sprite.js +0 -133
- package/dist/engineFlag.js +0 -104
- package/dist/export/SceneExporter.js +0 -286
- package/dist/export/glExport.js +0 -79
- package/dist/export/svgExport.js +0 -1803
- package/dist/interact/animationPlayback.js +0 -358
- package/dist/interact/canvasInteractions.js +0 -174
- package/dist/interact/cropSession.js +0 -527
- package/dist/interact/dblClick.js +0 -120
- package/dist/interact/expandSession.js +0 -282
- package/dist/interact/hotkeyActions.js +0 -42
- package/dist/interact/pageTransfer.js +0 -56
- package/dist/interact/pathSession.js +0 -480
- package/dist/interact/pointer.js +0 -1692
- package/dist/interact/pointerTablePuzzle.js +0 -358
- package/dist/interact/pointerTransform.js +0 -441
- package/dist/interact/pointerTypes.js +0 -96
- package/dist/interact/snapGuide.js +0 -377
- package/dist/interact/tableCellEditing.js +0 -207
- package/dist/interact/tableInteraction.js +0 -219
- package/dist/interact/textEditing.js +0 -423
- package/dist/interact/warpFacade.js +0 -51
- package/dist/interact/warpSession.js +0 -583
- package/dist/interact/wheelScroll.js +0 -100
- package/dist/model/alphaHit.js +0 -267
- package/dist/model/animation.js +0 -510
- package/dist/model/arcLayout.js +0 -308
- package/dist/model/arcTextTransform.js +0 -87
- package/dist/model/compatEvents.js +0 -96
- package/dist/model/compatObject.js +0 -1583
- package/dist/model/cropEdit.js +0 -497
- package/dist/model/document.js +0 -590
- package/dist/model/elementTypes.js +0 -119
- package/dist/model/expandEdit.js +0 -161
- package/dist/model/fabricPrimitives.js +0 -9
- package/dist/model/filler.js +0 -1
- package/dist/model/groupAssemble.js +0 -98
- package/dist/model/groupChildMove.js +0 -145
- package/dist/model/groupResize.js +0 -109
- package/dist/model/handles.js +0 -29
- package/dist/model/imageMaskBake.js +0 -136
- package/dist/model/lineConstruct.js +0 -79
- package/dist/model/maskCropEdit.js +0 -90
- package/dist/model/pathBackground.js +0 -196
- package/dist/model/pathConstruct.js +0 -55
- package/dist/model/pathEdit.js +0 -378
- package/dist/model/puzzleEdit.js +0 -742
- package/dist/model/puzzleLayout.js +0 -143
- package/dist/model/scene.js +0 -2930
- package/dist/model/schema.js +0 -13
- package/dist/model/shapePath.js +0 -137
- package/dist/model/smartObjectBake.js +0 -295
- package/dist/model/tableEdit.js +0 -751
- package/dist/model/tableFacade.js +0 -808
- package/dist/model/tableLayout.js +0 -194
- package/dist/model/textAlign.js +0 -36
- package/dist/model/textLayout.js +0 -842
- package/dist/render/GLBlend.js +0 -270
- package/dist/render/GLContext.js +0 -48
- package/dist/render/GLIsolate.js +0 -188
- package/dist/render/GLTextureCache.js +0 -224
- package/dist/render/GlyphAtlas.js +0 -412
- package/dist/render/MeshBatch.js +0 -416
- package/dist/render/QuadBatch.js +0 -561
- package/dist/render/SceneRenderer.js +0 -753
- package/dist/render/SourceManager.js +0 -523
- package/dist/render/TextRenderer.js +0 -854
- package/dist/render/arcText.js +0 -187
- package/dist/render/bakeGate.js +0 -32
- package/dist/render/batchOrder.js +0 -168
- package/dist/render/blendMode.js +0 -142
- package/dist/render/clipMaskPainter.js +0 -244
- package/dist/render/fontInvalidation.js +0 -77
- package/dist/render/fontInvalidationController.js +0 -119
- package/dist/render/frameOverlay.js +0 -124
- package/dist/render/framePipeline.js +0 -96
- package/dist/render/gpuFilterPasses.js +0 -883
- package/dist/render/gpuFx.js +0 -673
- package/dist/render/gpuImageFilters.js +0 -295
- package/dist/render/gpuShadow.js +0 -327
- package/dist/render/gradientRamp.js +0 -74
- package/dist/render/imageEffects.js +0 -415
- package/dist/render/lineDecorationSdf.js +0 -189
- package/dist/render/maskRender.js +0 -217
- package/dist/render/multiPage.js +0 -420
- package/dist/render/progressiveLoad.js +0 -86
- package/dist/render/psdEffectPainter.js +0 -333
- package/dist/render/psdWarpText.js +0 -212
- package/dist/render/puzzleClamp.js +0 -30
- package/dist/render/renderEpoch.js +0 -35
- package/dist/render/renderViewport.js +0 -18
- package/dist/render/retainedFrame.js +0 -192
- package/dist/render/ruler.js +0 -287
- package/dist/render/screenClip.js +0 -67
- package/dist/render/scrollText.js +0 -266
- package/dist/render/segmentTable.js +0 -117
- package/dist/render/selectionOverlay.js +0 -1008
- package/dist/render/settleScheduler.js +0 -51
- package/dist/render/shaders.js +0 -450
- package/dist/render/shadowBake.js +0 -203
- package/dist/render/shadowPainter.js +0 -93
- package/dist/render/sharedGpuPainters.js +0 -42
- package/dist/render/sourceHydration.js +0 -48
- package/dist/render/strokeBake.js +0 -516
- package/dist/render/strokeMiterOutline.js +0 -224
- package/dist/render/strokePainter.js +0 -207
- package/dist/render/strokeSdf.js +0 -262
- package/dist/render/svgRaster.js +0 -71
- package/dist/render/tableOverlay.js +0 -233
- package/dist/render/textHighlight.js +0 -380
- package/dist/render/textureUpload.js +0 -26
- package/dist/render/verticalText.js +0 -63
- package/dist/render/warpText.js +0 -384
- package/dist/render/workspaceBackdrop.js +0 -60
- package/dist/render/workspaceChecker.js +0 -170
- package/dist/render/workspaceGlow.js +0 -198
package/dist/debug/seed.js
CHANGED
|
@@ -1,3806 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* 都无抗锯齿边缘,是逐像素比对的稳定基线;带旋转/缩放的场景用宽松容差。
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
.padStart(2, '0');
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
for (let i = 0; i < count; i++) {
|
|
30
|
-
const w = 20 + Math.floor(rand() * 120);
|
|
31
|
-
const h = 20 + Math.floor(rand() * 120);
|
|
32
|
-
objects.push({
|
|
33
|
-
type: 'rect',
|
|
34
|
-
id: `r${i}`,
|
|
35
|
-
left: Math.floor(rand() * (bounds.width - w)),
|
|
36
|
-
top: Math.floor(rand() * (bounds.height - h)),
|
|
37
|
-
width: w,
|
|
38
|
-
height: h,
|
|
39
|
-
scaleX: 1,
|
|
40
|
-
scaleY: 1,
|
|
41
|
-
angle: 0,
|
|
42
|
-
fill: `#${toHex(0.2 + rand() * 0.8)}${toHex(0.2 + rand() * 0.8)}${toHex(0.2 + rand() * 0.8)}`,
|
|
43
|
-
opacity: 1,
|
|
44
|
-
originX: 'left',
|
|
45
|
-
originY: 'top',
|
|
46
|
-
strokeWidth: 0,
|
|
47
|
-
visible: true
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
return objects;
|
|
51
|
-
};
|
|
52
|
-
/** 素材图片链接(真实 URL,走 fetch → decode → 纹理链路,而非合成 dataURL)。
|
|
53
|
-
* 两类来源:
|
|
54
|
-
* - 本地打包素材(app PatternImages 图案族)经 Vite 静态 URL,dev/e2e 同源直出、离线可用;
|
|
55
|
-
* - 稿定素材 CDN 走 dev 代理 /gaoding-material(同源转发到 st0.dancf.com)。CDN 本身
|
|
56
|
-
* 不带 CORS 头,WebGL 纹理上传要求 CORS 干净,裸 https 链接会加载失败,必须走代理;
|
|
57
|
-
* resize,w_640 把 2400² 原图压到 640²,控制画布占比与解码成本。 */
|
|
58
|
-
const assetUrl = (path) => new URL(path, import.meta.url).href;
|
|
59
|
-
const MATERIAL_IMAGE_SRCS = [
|
|
60
|
-
assetUrl('../../assets/images/retina_wood.png'), // 512×512 木纹
|
|
61
|
-
assetUrl('../../assets/images/nasty_fabric.png'), // 198×200 织物
|
|
62
|
-
assetUrl('../../assets/images/greyfloral.png'), // 150×124 灰花卉
|
|
63
|
-
assetUrl('../../assets/images/honey_im_subtle.png'), // 179×132 蜂巢
|
|
64
|
-
assetUrl('../../assets/images/rotate.png'), // 200×200
|
|
65
|
-
'/gaoding-material/02/material_uploader/202106250601-e23c.jpg?x-oss-process=image/resize,w_640',
|
|
66
|
-
'/gaoding-material/02/material_uploader/202107060252-d51f.jpg?x-oss-process=image/resize,w_640'
|
|
67
|
-
];
|
|
68
|
-
/** 图片场景:真实素材链接 + 部分带缩放/旋转(宽松容差比对)。
|
|
69
|
-
* 不写 width/height——两侧统一回退位图 natural size(引擎 dims 兜底与 fabric
|
|
70
|
-
* FabricImage 默认同语义),种子因此无需预知素材尺寸;加载失败两侧都跳过该节点。
|
|
71
|
-
* 缩放只取放大(1~1.5):放大时 GL 双线性与 Canvas2D 过滤几乎一致;缩小的两侧
|
|
72
|
-
* 过滤算法差异是已知良好差异,属 Phase 1 议题。真实素材含硬边/高频细节,重采样
|
|
73
|
-
* 核差异远大于合成线性渐变,parity 靠降采样均值 + 放宽容差吸收(e2e 侧标注)。 */
|
|
74
|
-
export const makeImageScene = (count, seed = 7, bounds = { width: 2000, height: 1400 }) => {
|
|
75
|
-
const rand = mulberry32(seed);
|
|
76
|
-
const objects = [];
|
|
77
|
-
for (let i = 0; i < count; i++) {
|
|
78
|
-
const scale = 1 + rand() * 0.5;
|
|
79
|
-
objects.push({
|
|
80
|
-
type: 'image',
|
|
81
|
-
id: `img${i}`,
|
|
82
|
-
left: Math.floor(rand() * bounds.width),
|
|
83
|
-
top: Math.floor(rand() * bounds.height),
|
|
84
|
-
scaleX: scale,
|
|
85
|
-
scaleY: scale,
|
|
86
|
-
angle: Math.round(rand() * 4) * 15,
|
|
87
|
-
flipX: rand() > 0.7,
|
|
88
|
-
originX: 'left',
|
|
89
|
-
originY: 'top',
|
|
90
|
-
opacity: 1,
|
|
91
|
-
src: MATERIAL_IMAGE_SRCS[Math.floor(rand() * MATERIAL_IMAGE_SRCS.length)],
|
|
92
|
-
strokeWidth: 0,
|
|
93
|
-
visible: true
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
return objects;
|
|
97
|
-
};
|
|
98
|
-
/**
|
|
99
|
-
* SVG 源场景(批次 39——「二维码/条形码 zoom 放大后模糊」回归)。
|
|
100
|
-
*
|
|
101
|
-
* 生产口径:二维码/条形码(QRCode/BarCode extends FabricImage)的 src 是
|
|
102
|
-
* data:image/svg+xml 矢量——Canvas2D drawImage 按当前变换光栅化恒清晰,
|
|
103
|
-
* 引擎纹理必须按需重光栅化(render/svgRaster)。场景全用 base64 SVG data
|
|
104
|
-
* URL(离线确定性):
|
|
105
|
-
* - qr0:QRCode 118×118(生产同尺寸,21×21 模块盘 + 三 finder)
|
|
106
|
-
* - qr1:QRCode 旋转 30° + scale 1.5(worldScale 口径的放大需求)
|
|
107
|
-
* - bar0:BarCode 200×80(jsbarcode 风:变宽条 + 静区)
|
|
108
|
-
* - svg0:svgimage 160×160(通用矢量图:圆 + 三角 + 环)
|
|
109
|
-
*/
|
|
110
|
-
export const makeSvgImageScene = () => {
|
|
111
|
-
const svgDataUrl = (svg) => `data:image/svg+xml;base64,${btoa(svg)}`;
|
|
112
|
-
// QR 风 21×21 模块盘:三 finder(7×7 双环)+ PRNG 数据模块(finder 区留空)
|
|
113
|
-
const N = 21;
|
|
114
|
-
const rand = mulberry32(39);
|
|
115
|
-
const inFinder = (x, y) => (x < 8 && y < 8) || (x > N - 9 && y < 8) || (x < 8 && y > N - 9);
|
|
116
|
-
let cells = '';
|
|
117
|
-
for (let y = 0; y < N; y++) {
|
|
118
|
-
for (let x = 0; x < N; x++) {
|
|
119
|
-
const on = inFinder(x, y) ? false : rand() > 0.52;
|
|
120
|
-
if (on)
|
|
121
|
-
cells += `<rect x="${x}" y="${y}" width="1" height="1"/>`;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
const finder = (fx, fy) => `<rect x="${fx}" y="${fy}" width="7" height="7" fill="none" stroke="#000" stroke-width="1"/>` + `<rect x="${fx + 2}" y="${fy + 2}" width="3" height="3"/>`;
|
|
125
|
-
const qrSvg = `<svg xmlns="http://www.w3.org/2000/svg" width="118" height="118" viewBox="0 0 ${N} ${N}">` +
|
|
126
|
-
`<rect width="${N}" height="${N}" fill="#fff"/><g fill="#000">${cells}</g>` +
|
|
127
|
-
`<g fill="#000">${finder(0, 0)}${finder(N - 7, 0)}${finder(0, N - 7)}</g></svg>`;
|
|
128
|
-
// 条码风:变宽黑白条(确定性序列)+ 上下静区
|
|
129
|
-
const brand = mulberry32(77);
|
|
130
|
-
let bars = '';
|
|
131
|
-
let bx = 4;
|
|
132
|
-
while (bx < 192) {
|
|
133
|
-
const w = 2 + Math.floor(brand() * 5);
|
|
134
|
-
bars += `<rect x="${bx}" y="12" width="${w}" height="56"/>`;
|
|
135
|
-
bx += w + 2 + Math.floor(brand() * 4);
|
|
136
|
-
}
|
|
137
|
-
const barSvg = `<svg xmlns="http://www.w3.org/2000/svg" width="200" height="80" viewBox="0 0 200 80">` + `<rect width="200" height="80" fill="#fff"/><g fill="#000">${bars}</g></svg>`;
|
|
138
|
-
const logoSvg = `<svg xmlns="http://www.w3.org/2000/svg" width="160" height="160" viewBox="0 0 160 160">` +
|
|
139
|
-
`<rect width="160" height="160" fill="#fff"/><circle cx="62" cy="66" r="40" fill="#1f66ff"/>` +
|
|
140
|
-
`<path d="M84 34 L140 118 L28 118 Z" fill="#ff8d23"/><circle cx="118" cy="106" r="22" fill="none" stroke="#111" stroke-width="6"/></svg>`;
|
|
141
|
-
const base = {
|
|
142
|
-
scaleX: 1,
|
|
143
|
-
scaleY: 1,
|
|
144
|
-
angle: 0,
|
|
145
|
-
originX: 'left',
|
|
146
|
-
originY: 'top',
|
|
147
|
-
opacity: 1,
|
|
148
|
-
strokeWidth: 0,
|
|
149
|
-
visible: true,
|
|
150
|
-
crossOrigin: 'anonymous'
|
|
151
|
-
};
|
|
152
|
-
return [
|
|
153
|
-
{ ...base, type: 'QRCode', id: 'qr0', left: 120, top: 100, src: svgDataUrl(qrSvg), codeContent: 'https://yft.design', codeOption: { codeStyle: 'A1', codeSpace: false, codeError: 0 } },
|
|
154
|
-
{
|
|
155
|
-
...base,
|
|
156
|
-
type: 'QRCode',
|
|
157
|
-
id: 'qr1',
|
|
158
|
-
left: 360,
|
|
159
|
-
top: 100,
|
|
160
|
-
angle: 30,
|
|
161
|
-
scaleX: 1.5,
|
|
162
|
-
scaleY: 1.5,
|
|
163
|
-
src: svgDataUrl(qrSvg),
|
|
164
|
-
codeContent: 'https://yft.design',
|
|
165
|
-
codeOption: { codeStyle: 'A1', codeSpace: false, codeError: 0 }
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
...base,
|
|
169
|
-
type: 'BarCode',
|
|
170
|
-
id: 'bar0',
|
|
171
|
-
left: 120,
|
|
172
|
-
top: 360,
|
|
173
|
-
src: svgDataUrl(barSvg),
|
|
174
|
-
codeContent: 'YFT-39',
|
|
175
|
-
codeOption: { format: 'code128', width: 2, height: 40, displayValue: true, background: '#ffffff' }
|
|
176
|
-
},
|
|
177
|
-
{ ...base, type: 'svgimage', id: 'svg0', left: 420, top: 320, src: svgDataUrl(logoSvg) }
|
|
178
|
-
];
|
|
179
|
-
};
|
|
180
|
-
/**
|
|
181
|
-
* 图片静态裁剪场景(B1):cropX/cropY 双序列化口径(legacy=缺省 width 含偏移、
|
|
182
|
-
* visible=width 即可见宽,应用 FabricImage.toObject/fromObject 的往返约定)。
|
|
183
|
-
* 素材用本地打包图(尺寸已知、离线可用):nasty_fabric 198×200、
|
|
184
|
-
* greyfloral 150×124、rotate 200×200、retina_wood 512×512。
|
|
185
|
-
* 覆盖:legacy 全偏移 / visible 口径 / 裁剪+旋转+翻转 / 裁剪+原生 shadow /
|
|
186
|
-
* 裁剪+PSD dropShadow(烘焙源子矩形)/ 单轴 legacy。
|
|
187
|
-
*/
|
|
188
|
-
export const makeCropImageScene = () => {
|
|
189
|
-
const base = {
|
|
190
|
-
type: 'image',
|
|
191
|
-
scaleX: 1,
|
|
192
|
-
scaleY: 1,
|
|
193
|
-
angle: 0,
|
|
194
|
-
originX: 'left',
|
|
195
|
-
originY: 'top',
|
|
196
|
-
opacity: 1,
|
|
197
|
-
strokeWidth: 0,
|
|
198
|
-
visible: true,
|
|
199
|
-
src: assetUrl('../../assets/images/nasty_fabric.png')
|
|
200
|
-
};
|
|
201
|
-
const fabricSrc = assetUrl('../../assets/images/greyfloral.png');
|
|
202
|
-
const rotateSrc = assetUrl('../../assets/images/rotate.png');
|
|
203
|
-
const woodSrc = assetUrl('../../assets/images/retina_wood.png');
|
|
204
|
-
return [
|
|
205
|
-
// cr0 legacy:可见 120×140 → 盘上 width=160/height=170(右缘坐标语义)
|
|
206
|
-
{ ...base, id: 'cr0', left: 60, top: 40, scaleX: 1.5, scaleY: 1.5, cropX: 40, cropY: 30, width: 160, height: 170 },
|
|
207
|
-
// cr1 visible:width/height 即可见尺寸(PDF 导入链路口径)
|
|
208
|
-
{ ...base, id: 'cr1', left: 320, top: 40, src: rotateSrc, cropX: 30, cropY: 20, width: 100, height: 80, cropSizeMode: 'visible' },
|
|
209
|
-
// cr2 legacy + 旋转 + 水平翻转:可见 100×86 → width=125/height=105
|
|
210
|
-
{ ...base, id: 'cr2', left: 560, top: 60, src: fabricSrc, angle: 30, flipX: true, scaleX: 1.6, scaleY: 1.6, cropX: 25, cropY: 19, width: 125, height: 105 },
|
|
211
|
-
// cr3 visible + 原生 shadow(剪影子矩形;composite 口径对拍)
|
|
212
|
-
{
|
|
213
|
-
...base,
|
|
214
|
-
id: 'cr3',
|
|
215
|
-
left: 60,
|
|
216
|
-
top: 320,
|
|
217
|
-
src: woodSrc,
|
|
218
|
-
scaleX: 0.9,
|
|
219
|
-
scaleY: 0.9,
|
|
220
|
-
cropX: 100,
|
|
221
|
-
cropY: 120,
|
|
222
|
-
width: 200,
|
|
223
|
-
height: 160,
|
|
224
|
-
cropSizeMode: 'visible',
|
|
225
|
-
shadow: { color: 'rgba(40,40,60,0.45)', blur: 12, offsetX: 10, offsetY: 10, affectStroke: false, nonScaling: false }
|
|
226
|
-
},
|
|
227
|
-
// cr4 visible + PSD dropShadow(bakePsdShadow 源子矩形)
|
|
228
|
-
{
|
|
229
|
-
...base,
|
|
230
|
-
id: 'cr4',
|
|
231
|
-
left: 360,
|
|
232
|
-
top: 340,
|
|
233
|
-
src: fabricSrc,
|
|
234
|
-
angle: 15,
|
|
235
|
-
scaleX: 1.8,
|
|
236
|
-
scaleY: 1.8,
|
|
237
|
-
cropX: 20,
|
|
238
|
-
cropY: 12,
|
|
239
|
-
width: 96,
|
|
240
|
-
height: 84,
|
|
241
|
-
cropSizeMode: 'visible',
|
|
242
|
-
effects: { dropShadow: [{ enabled: true, showInDialog: true, fill: 'rgba(60,50,40,0.45)', blur: 10, offsetX: 12, offsetY: 12 }] }
|
|
243
|
-
},
|
|
244
|
-
// cr5 legacy 单轴(cropY=0):可见宽=198−58=140、高=200 全高
|
|
245
|
-
{ ...base, id: 'cr5', left: 760, top: 330, scaleX: 1.3, scaleY: 0.8, cropX: 58, cropY: 0, width: 198, height: 200 }
|
|
246
|
-
];
|
|
247
|
-
};
|
|
248
|
-
/**
|
|
249
|
-
* 智能对象双击场景(P5-7):图片族节点带 PSD 导入产出的 smartObject 元数据
|
|
250
|
-
* (handlePSD.getImageElement + layer.placedLayer 形态,透视变形已烘焙进 src,
|
|
251
|
-
* smartObject 仅是编辑入口元数据)。覆盖双击派发与桥接映射的口径:
|
|
252
|
-
* - so0 全量元数据(id/placed/name/width/height/transform/parseStatus)
|
|
253
|
-
* - so1 缺 width/height/name(natural 198×200 回落 + layer 名回落)+ 旋转缩放
|
|
254
|
-
* - so2 无 smartObject 的普通图片(image:replace-requested 分支)
|
|
255
|
-
* e2e 经 dblclick → getEditingEventLog 断言映射后的 openSmartObjectDocument
|
|
256
|
-
* 参数(smartObjectOpenOptions 与 FabricImage.doubleClickHandler 同源)。
|
|
257
|
-
*/
|
|
258
|
-
export const makeSmartObjectScene = () => {
|
|
259
|
-
const base = {
|
|
260
|
-
type: 'image',
|
|
261
|
-
scaleX: 1,
|
|
262
|
-
scaleY: 1,
|
|
263
|
-
angle: 0,
|
|
264
|
-
originX: 'left',
|
|
265
|
-
originY: 'top',
|
|
266
|
-
opacity: 1,
|
|
267
|
-
strokeWidth: 0,
|
|
268
|
-
visible: true,
|
|
269
|
-
src: assetUrl('../../assets/images/nasty_fabric.png')
|
|
270
|
-
};
|
|
271
|
-
return [
|
|
272
|
-
{
|
|
273
|
-
...base,
|
|
274
|
-
id: 'so0',
|
|
275
|
-
left: 60,
|
|
276
|
-
top: 40,
|
|
277
|
-
layer: 'Hero Title',
|
|
278
|
-
smartObject: {
|
|
279
|
-
id: 'placed-1',
|
|
280
|
-
placed: 'plc-1',
|
|
281
|
-
name: 'hero-title',
|
|
282
|
-
type: 'image',
|
|
283
|
-
width: 480,
|
|
284
|
-
height: 360,
|
|
285
|
-
transform: [0, 0, 480, 0, 480, 360, 0, 360],
|
|
286
|
-
parseStatus: 'success'
|
|
287
|
-
}
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
...base,
|
|
291
|
-
id: 'so1',
|
|
292
|
-
left: 320,
|
|
293
|
-
top: 40,
|
|
294
|
-
angle: 15,
|
|
295
|
-
scaleX: 1.4,
|
|
296
|
-
scaleY: 1.2,
|
|
297
|
-
layer: 'Badge Layer',
|
|
298
|
-
smartObject: {
|
|
299
|
-
id: 'placed-2',
|
|
300
|
-
name: '',
|
|
301
|
-
parseStatus: 'success'
|
|
302
|
-
}
|
|
303
|
-
},
|
|
304
|
-
{ ...base, id: 'so2', left: 580, top: 40, layer: 'Plain Photo' }
|
|
305
|
-
];
|
|
306
|
-
};
|
|
307
|
-
/**
|
|
308
|
-
* 图片滤镜场景(B1(余) GPU 化):31 个单滤镜 + 5 组合,序列化形态与
|
|
309
|
-
* UI 产出严格一致(fabric BaseFilter.toObject = type + defaults 键;预设式
|
|
310
|
-
* FilterImage 单选替换、滑块式 FilterElement 同类去重后叠加)。
|
|
311
|
-
* 素材 rotate.png 200×200 / nasty_fabric 198×200(尺寸已知、离线可用)。
|
|
312
|
-
* 覆盖:fabric 内置(Brightness/Contrast/Saturation/Vibrance/Hue/Grayscale/
|
|
313
|
-
* 六个 ColorMatrix 固定滤镜/Invert/Convolute 锐化·浮雕/BlendColor/Blur/
|
|
314
|
-
* Pixelate)+ 应用自定义 16 款全量 + 组合(滤镜栈序、滤镜×裁剪、滤镜×
|
|
315
|
-
* 旋转翻转、滤镜×原生 shadow、滤镜×PSD 投影)。
|
|
316
|
-
* 规避:内置 Noise(uSeed=Math.random() 每渲染重掷,不可逐像素对拍——
|
|
317
|
-
* FilmGrain 的 seed 序列化确定性已覆盖哈希噪声路径)。
|
|
318
|
-
*/
|
|
319
|
-
export const makeFilterImageScene = () => {
|
|
320
|
-
const base = {
|
|
321
|
-
type: 'image',
|
|
322
|
-
scaleX: 1,
|
|
323
|
-
scaleY: 1,
|
|
324
|
-
angle: 0,
|
|
325
|
-
originX: 'left',
|
|
326
|
-
originY: 'top',
|
|
327
|
-
opacity: 1,
|
|
328
|
-
strokeWidth: 0,
|
|
329
|
-
visible: true,
|
|
330
|
-
src: assetUrl('../../assets/images/rotate.png')
|
|
331
|
-
};
|
|
332
|
-
const fabricSrc = assetUrl('../../assets/images/nasty_fabric.png');
|
|
333
|
-
// 4 列网格:格 240×240(图 200×200 + 40 呼吸),行主序落位
|
|
334
|
-
const grid = (i) => ({ left: 40 + (i % 4) * 240, top: 40 + Math.floor(i / 4) * 240 });
|
|
335
|
-
const one = (i, filters, extra = {}) => ({
|
|
336
|
-
...base,
|
|
337
|
-
id: `f${i}`,
|
|
338
|
-
...grid(i),
|
|
339
|
-
filters,
|
|
340
|
-
...extra
|
|
341
|
-
});
|
|
342
|
-
return [
|
|
343
|
-
// ---- fabric 内置 ----
|
|
344
|
-
one(0, [{ type: 'Brightness', brightness: 0.3 }]),
|
|
345
|
-
one(1, [{ type: 'Contrast', contrast: 0.35 }]),
|
|
346
|
-
one(2, [{ type: 'Saturation', saturation: 0.5 }]),
|
|
347
|
-
one(3, [{ type: 'Vibrance', vibrance: 0.4 }]),
|
|
348
|
-
one(4, [{ type: 'HueRotation', rotation: 0.5 }]),
|
|
349
|
-
one(5, [{ type: 'Grayscale', mode: 'average' }]),
|
|
350
|
-
one(6, [{ type: 'Sepia', colorsOnly: false }]),
|
|
351
|
-
one(7, [{ type: 'Brownie', colorsOnly: false }]),
|
|
352
|
-
one(8, [{ type: 'Kodachrome', colorsOnly: false }]),
|
|
353
|
-
one(9, [{ type: 'Technicolor', colorsOnly: false }]),
|
|
354
|
-
one(10, [{ type: 'Polaroid', colorsOnly: false }]),
|
|
355
|
-
one(11, [{ type: 'BlackWhite', colorsOnly: false }]),
|
|
356
|
-
one(12, [{ type: 'Invert', invert: true, alphaOnly: false }]),
|
|
357
|
-
// 锐化(UI 预设 Convolute 矩阵)/ 浮雕
|
|
358
|
-
one(13, [{ type: 'Convolute', opaque: false, matrix: [0, -1, 0, -1, 5, -1, 0, -1, 0] }]),
|
|
359
|
-
one(14, [{ type: 'Convolute', opaque: false, matrix: [1, 1, 1, 1, 0.7, -1, -1, -1, -1] }]),
|
|
360
|
-
// 着色(UI 预设 BlendColor overlay)
|
|
361
|
-
one(15, [{ type: 'BlendColor', color: '#ff6600', mode: 'overlay', alpha: 0.4 }]),
|
|
362
|
-
// PS 口径高斯:blur = 像素半径(σ=r/2 三趟 box,2026-09-21 对齐批次)
|
|
363
|
-
one(16, [{ type: 'Blur', blur: 8 }]),
|
|
364
|
-
one(17, [{ type: 'Pixelate', blocksize: 6 }]),
|
|
365
|
-
// ---- 应用自定义 16 款 ----
|
|
366
|
-
one(18, [{ type: 'Vignette', intensity: 0.6 }]),
|
|
367
|
-
one(19, [{ type: 'Temperature', temperature: 0.5 }]),
|
|
368
|
-
one(20, [{ type: 'Posterize', levels: 6 }]),
|
|
369
|
-
one(21, [{ type: 'FilmGrain', intensity: 0.35, seed: 7.13 }]),
|
|
370
|
-
one(22, [{ type: 'Duotone', color1: '#2E003E', color2: '#FF6EC7' }]),
|
|
371
|
-
one(23, [{ type: 'Sketch' }]),
|
|
372
|
-
one(24, [{ type: 'ChromaticAberration', offset: 6 }]),
|
|
373
|
-
one(25, [{ type: 'SoftFocus', blend: 0.6 }]),
|
|
374
|
-
one(26, [{ type: 'Threshold', threshold: 128 }]),
|
|
375
|
-
one(27, [{ type: 'UnsharpMask', amount: 1.2 }]),
|
|
376
|
-
one(28, [{ type: 'MotionBlur', distance: 0.15, angle: 0.3 }]),
|
|
377
|
-
one(29, [{ type: 'LensFlare', intensity: 0.8 }]),
|
|
378
|
-
one(30, [{ type: 'GradientMap', color0: '#0a0020', color1: '#ff4466', color2: '#ffdd44' }]),
|
|
379
|
-
one(31, [{ type: 'GradientMap', color0: '#001040', color1: '#ffe0b0' }]),
|
|
380
|
-
one(32, [{ type: 'Levels', blackPoint: 30, whitePoint: 220, gamma: 1.4 }]),
|
|
381
|
-
one(33, [{ type: 'SurfaceBlur', radius: 3, threshold: 0.2 }]),
|
|
382
|
-
one(34, [{ type: 'Exposure', exposure: 0.6, offset: 0, gamma: 1 }]),
|
|
383
|
-
// ---- 组合 ----
|
|
384
|
-
// 滤镜栈(滑块叠加序:Brightness → Contrast → Vignette,序敏感)
|
|
385
|
-
one(35, [
|
|
386
|
-
{ type: 'Brightness', brightness: 0.15 },
|
|
387
|
-
{ type: 'Contrast', contrast: 0.25 },
|
|
388
|
-
{ type: 'Vignette', intensity: 0.5 }
|
|
389
|
-
]),
|
|
390
|
-
// 滤镜 × 裁剪(visible 口径):滤镜跑全图、cropX/Y 后开窗
|
|
391
|
-
one(36, [{ type: 'Sepia', colorsOnly: false }], { cropX: 30, cropY: 30, width: 120, height: 120, cropSizeMode: 'visible' }),
|
|
392
|
-
// 滤镜 × 旋转 + 翻转
|
|
393
|
-
one(37, [{ type: 'Duotone', color1: '#102040', color2: '#FFD070' }], { src: fabricSrc, angle: 25, flipX: true, scaleX: 1.4, scaleY: 1.4 }),
|
|
394
|
-
// 滤镜 × 原生 shadow(alpha 保持 → 剪影不受滤镜影响)
|
|
395
|
-
one(38, [{ type: 'Grayscale', mode: 'luminosity' }], {
|
|
396
|
-
shadow: { color: 'rgba(40,40,60,0.45)', blur: 12, offsetX: 10, offsetY: 10, affectStroke: false, nonScaling: false }
|
|
397
|
-
}),
|
|
398
|
-
// 滤镜 × PSD 投影(effects 分支走应用 FabricImage——两条定制链同图组合)
|
|
399
|
-
one(39, [{ type: 'Technicolor', colorsOnly: false }], {
|
|
400
|
-
angle: 15,
|
|
401
|
-
scaleX: 1.3,
|
|
402
|
-
scaleY: 1.3,
|
|
403
|
-
effects: { dropShadow: [{ enabled: true, showInDialog: true, fill: 'rgba(60,50,40,0.45)', blur: 10, offsetX: 12, offsetY: 12 }] }
|
|
404
|
-
})
|
|
405
|
-
];
|
|
406
|
-
};
|
|
407
|
-
/**
|
|
408
|
-
* 文本场景(Phase 2a):CJK/拉丁/混排 + 换行/对齐/字距/行距组合。
|
|
409
|
-
* 字体用 chromium 内置族(避免 e2e 环境字体加载差异),字号偏大(hinting 差异
|
|
410
|
-
* 随字号增大而稀释)。覆盖:硬换行、自动换行、center/right、charSpacing、
|
|
411
|
-
* 多行 lineHeight、无换行 text 类型;P2-2 增补:逐字 fontSize/fontFamily
|
|
412
|
-
* 混排(t7 换行度量 + t8 无换行);justify 增补:t9 纯 justify 多行拉伸
|
|
413
|
-
* (段末行照拉、末行豁免——产品 fork 口径,末行为单词行两侧都拉不动)、
|
|
414
|
-
* t10 justify-center 段末行居中收尾 + CJK 行不拉伸(变体恒空格粒度)。
|
|
415
|
-
*/
|
|
416
|
-
export const makeTextScene = () => {
|
|
417
|
-
const base = {
|
|
418
|
-
type: 'textbox',
|
|
419
|
-
scaleX: 1,
|
|
420
|
-
scaleY: 1,
|
|
421
|
-
angle: 0,
|
|
422
|
-
originX: 'left',
|
|
423
|
-
originY: 'top',
|
|
424
|
-
opacity: 1,
|
|
425
|
-
strokeWidth: 0,
|
|
426
|
-
visible: true,
|
|
427
|
-
fill: '#1a1a1a'
|
|
428
|
-
};
|
|
429
|
-
return [
|
|
430
|
-
{
|
|
431
|
-
...base,
|
|
432
|
-
id: 't0',
|
|
433
|
-
left: 80,
|
|
434
|
-
top: 60,
|
|
435
|
-
width: 620,
|
|
436
|
-
text: '你好,WebGL2 设计引擎!字形图集渲染。',
|
|
437
|
-
fontFamily: 'sans-serif',
|
|
438
|
-
fontSize: 56,
|
|
439
|
-
fontWeight: 'bold',
|
|
440
|
-
lineHeight: 1.16,
|
|
441
|
-
charSpacing: 0,
|
|
442
|
-
textAlign: 'left'
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
...base,
|
|
446
|
-
id: 't6',
|
|
447
|
-
left: 80,
|
|
448
|
-
top: 640,
|
|
449
|
-
width: 560,
|
|
450
|
-
text: 'Rich text with per char colors and highlight marks 你好。',
|
|
451
|
-
fontFamily: 'sans-serif',
|
|
452
|
-
fontSize: 38,
|
|
453
|
-
lineHeight: 1.3,
|
|
454
|
-
charSpacing: 0,
|
|
455
|
-
textAlign: 'left',
|
|
456
|
-
fill: '#101010',
|
|
457
|
-
// 逐字符样式(fabric styles 结构):两段着色 + 一段高亮
|
|
458
|
-
styles: {
|
|
459
|
-
0: {
|
|
460
|
-
0: { fill: '#c03030' },
|
|
461
|
-
1: { fill: '#c03030' },
|
|
462
|
-
2: { fill: '#c03030' },
|
|
463
|
-
3: { fill: '#c03030' },
|
|
464
|
-
10: { fill: '#2060c0', textBackgroundColor: '#ffe08a' },
|
|
465
|
-
11: { fill: '#2060c0', textBackgroundColor: '#ffe08a' },
|
|
466
|
-
12: { fill: '#2060c0', textBackgroundColor: '#ffe08a' },
|
|
467
|
-
13: { fill: '#2060c0', textBackgroundColor: '#ffe08a' },
|
|
468
|
-
14: { fill: '#2060c0', textBackgroundColor: '#ffe08a' }
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
},
|
|
472
|
-
{
|
|
473
|
-
...base,
|
|
474
|
-
id: 't1',
|
|
475
|
-
left: 80,
|
|
476
|
-
top: 200,
|
|
477
|
-
width: 400,
|
|
478
|
-
text: 'The quick brown fox jumps over the lazy dog and wraps here.',
|
|
479
|
-
fontFamily: 'serif',
|
|
480
|
-
fontSize: 40,
|
|
481
|
-
lineHeight: 1.25,
|
|
482
|
-
charSpacing: 0,
|
|
483
|
-
textAlign: 'left',
|
|
484
|
-
fill: '#2050a0'
|
|
485
|
-
},
|
|
486
|
-
{
|
|
487
|
-
...base,
|
|
488
|
-
id: 't2',
|
|
489
|
-
left: 80,
|
|
490
|
-
top: 420,
|
|
491
|
-
width: 520,
|
|
492
|
-
text: '居中对齐的中文标题\n第二行小字 world',
|
|
493
|
-
fontFamily: 'sans-serif',
|
|
494
|
-
fontSize: 48,
|
|
495
|
-
lineHeight: 1.4,
|
|
496
|
-
charSpacing: 80,
|
|
497
|
-
textAlign: 'center',
|
|
498
|
-
fill: '#a03030'
|
|
499
|
-
},
|
|
500
|
-
{
|
|
501
|
-
...base,
|
|
502
|
-
id: 't3',
|
|
503
|
-
left: 700,
|
|
504
|
-
top: 60,
|
|
505
|
-
width: 460,
|
|
506
|
-
text: '右对齐 Right aligned with spacing.',
|
|
507
|
-
fontFamily: 'monospace',
|
|
508
|
-
fontSize: 32,
|
|
509
|
-
lineHeight: 1.16,
|
|
510
|
-
charSpacing: 50,
|
|
511
|
-
textAlign: 'right',
|
|
512
|
-
fill: '#106010'
|
|
513
|
-
},
|
|
514
|
-
{
|
|
515
|
-
...base,
|
|
516
|
-
id: 't4',
|
|
517
|
-
left: 700,
|
|
518
|
-
top: 240,
|
|
519
|
-
width: 480,
|
|
520
|
-
text: '自动换行的中文长句会按照盒宽在词语与字符之间断行,验证 CJK 换行状态机。',
|
|
521
|
-
fontFamily: 'sans-serif',
|
|
522
|
-
fontSize: 36,
|
|
523
|
-
lineHeight: 1.5,
|
|
524
|
-
charSpacing: 0,
|
|
525
|
-
textAlign: 'left',
|
|
526
|
-
fill: '#404040'
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
...base,
|
|
530
|
-
id: 't5',
|
|
531
|
-
left: 700,
|
|
532
|
-
top: 520,
|
|
533
|
-
width: 480,
|
|
534
|
-
text: '不换行的 text 类型:Single line no wrap.',
|
|
535
|
-
type: 'text',
|
|
536
|
-
fontFamily: 'serif',
|
|
537
|
-
fontSize: 34,
|
|
538
|
-
lineHeight: 1.16,
|
|
539
|
-
charSpacing: 0,
|
|
540
|
-
textAlign: 'left',
|
|
541
|
-
fill: '#704080'
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
...base,
|
|
545
|
-
id: 't7',
|
|
546
|
-
left: 700,
|
|
547
|
-
top: 585,
|
|
548
|
-
width: 460,
|
|
549
|
-
// P2-2:逐字 fontSize/fontFamily 参与度量——混排字号行高、异族字体宽度、
|
|
550
|
-
// 大字号词撑盒(dynamicMinWidth)、换行吃掉的空格按原始偏移样式度量
|
|
551
|
-
text: 'Mixed sizes Big word fonts 混排字号.',
|
|
552
|
-
fontFamily: 'sans-serif',
|
|
553
|
-
fontSize: 24,
|
|
554
|
-
lineHeight: 1.35,
|
|
555
|
-
charSpacing: 0,
|
|
556
|
-
textAlign: 'left',
|
|
557
|
-
fill: '#303030',
|
|
558
|
-
styles: {
|
|
559
|
-
0: {
|
|
560
|
-
// 索引对应 "Mixed sizes Big word fonts 混排字号.":
|
|
561
|
-
// 6-7="si"(sizes 提到 40)、12-14="Big"(serif 36)、16-19="word"(monospace 30)
|
|
562
|
-
6: { fontSize: 40, fill: '#c03030' },
|
|
563
|
-
7: { fontSize: 40, fill: '#c03030' },
|
|
564
|
-
8: { fontSize: 40, fill: '#c03030' },
|
|
565
|
-
9: { fontSize: 40, fill: '#c03030' },
|
|
566
|
-
10: { fontSize: 40, fill: '#c03030' },
|
|
567
|
-
12: { fontSize: 36, fontFamily: 'serif' },
|
|
568
|
-
13: { fontSize: 36, fontFamily: 'serif' },
|
|
569
|
-
14: { fontSize: 36, fontFamily: 'serif' },
|
|
570
|
-
16: { fontSize: 30, fontFamily: 'monospace' },
|
|
571
|
-
17: { fontSize: 30, fontFamily: 'monospace' },
|
|
572
|
-
18: { fontSize: 30, fontFamily: 'monospace' },
|
|
573
|
-
19: { fontSize: 30, fontFamily: 'monospace' }
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
},
|
|
577
|
-
{
|
|
578
|
-
...base,
|
|
579
|
-
id: 't8',
|
|
580
|
-
left: 700,
|
|
581
|
-
top: 672,
|
|
582
|
-
// 不换行类型 + 逐字字号(光标/选区行高随逐字 max)
|
|
583
|
-
text: 'Cursor in mixed 123',
|
|
584
|
-
type: 'text',
|
|
585
|
-
fontFamily: 'sans-serif',
|
|
586
|
-
fontSize: 26,
|
|
587
|
-
lineHeight: 1.16,
|
|
588
|
-
charSpacing: 0,
|
|
589
|
-
textAlign: 'left',
|
|
590
|
-
fill: '#106040',
|
|
591
|
-
styles: {
|
|
592
|
-
0: {
|
|
593
|
-
17: { fontSize: 44 },
|
|
594
|
-
18: { fontSize: 44 }
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
},
|
|
598
|
-
{
|
|
599
|
-
...base,
|
|
600
|
-
id: 't9',
|
|
601
|
-
left: 80,
|
|
602
|
-
top: 760,
|
|
603
|
-
width: 400,
|
|
604
|
-
// 两端对齐(fabric enlargeSpaces 同源 + 产品 fork 口径 2026-10-14):多行
|
|
605
|
-
// 词隙拉伸、段末行照拉、纯 justify 只豁免最后一行(编辑器 fork;fabric
|
|
606
|
-
// 上游含末行全拉——两侧在此分道)。末行故意用单词行(无空格可拉)+ 硬换行
|
|
607
|
-
// 隔出段末行,两档豁免/照拉在台面上一眼可辨;fabric 对拍面已退役(批次
|
|
608
|
-
// 275),语义由 textLayout.spec 注入度量锁
|
|
609
|
-
text: 'The quick brown fox jumps over the lazy dog\nwrapword.',
|
|
610
|
-
fontFamily: 'serif',
|
|
611
|
-
fontSize: 40,
|
|
612
|
-
lineHeight: 1.25,
|
|
613
|
-
charSpacing: 0,
|
|
614
|
-
textAlign: 'justify',
|
|
615
|
-
fill: '#303030'
|
|
616
|
-
},
|
|
617
|
-
{
|
|
618
|
-
...base,
|
|
619
|
-
id: 't10',
|
|
620
|
-
left: 700,
|
|
621
|
-
top: 760,
|
|
622
|
-
width: 460,
|
|
623
|
-
// justify-center 变体:非段末行拉伸、段末行居中收尾;CJK 无空格行不拉伸
|
|
624
|
-
text: '两端对齐的中英混排 stretch spaces between words\nCJK 行没有空格不可拉伸',
|
|
625
|
-
fontFamily: 'sans-serif',
|
|
626
|
-
fontSize: 28,
|
|
627
|
-
lineHeight: 1.35,
|
|
628
|
-
charSpacing: 0,
|
|
629
|
-
textAlign: 'justify-center',
|
|
630
|
-
fill: '#204080'
|
|
631
|
-
}
|
|
632
|
-
];
|
|
633
|
-
};
|
|
634
|
-
/**
|
|
635
|
-
* 描边文本场景(Phase 2 P2-3)。
|
|
636
|
-
*
|
|
637
|
-
* 覆盖描边的四条语义:
|
|
638
|
-
* - k0/k1:同一文本、paintFirst 两种(fill 先 / stroke 先)——两遍渲染的顺序语义;
|
|
639
|
-
* - k2:fill 为空 = 纯描边(fabric `_renderTextFill` 整体跳过);
|
|
640
|
-
* - k3:逐字 stroke/strokeWidth 覆写(fabric fullDecl 合并语义);
|
|
641
|
-
* - k4:不带 strokeWidth(两侧都按 fabric 类默认 1);
|
|
642
|
-
* - k5:有 strokeWidth 但 stroke 为空——两侧都不画描边,但**文本整体偏移
|
|
643
|
-
* strokeWidth/2**(fabric 把 strokeWidth 计入变换尺寸),这条锁的是位置语义;
|
|
644
|
-
* - k6:带 scale/角度(变换链 + 描边随对象缩放);
|
|
645
|
-
* - k7:多行 + 半透明描边(考察逐字形合成)。
|
|
646
|
-
*
|
|
647
|
-
* 字号偏大(hinting 差随字号稀释)、字体用 chromium 内置族(避免字体加载差异)。
|
|
648
|
-
* 虚线描边(strokeDashArray)不在本场景:fabric 按行/run 一次 strokeText(相位连续),
|
|
649
|
-
* 引擎图集逐字形 cell(相位逐字重来),属 P3-2 的 run 级栅格化议题。
|
|
650
|
-
*/
|
|
651
|
-
export const makeStrokeTextScene = () => {
|
|
652
|
-
const base = {
|
|
653
|
-
type: 'textbox',
|
|
654
|
-
scaleX: 1,
|
|
655
|
-
scaleY: 1,
|
|
656
|
-
angle: 0,
|
|
657
|
-
originX: 'left',
|
|
658
|
-
originY: 'top',
|
|
659
|
-
opacity: 1,
|
|
660
|
-
strokeWidth: 0,
|
|
661
|
-
visible: true,
|
|
662
|
-
fill: '#1a1a1a'
|
|
663
|
-
};
|
|
664
|
-
return [
|
|
665
|
-
{
|
|
666
|
-
...base,
|
|
667
|
-
id: 'k0',
|
|
668
|
-
left: 40,
|
|
669
|
-
top: 30,
|
|
670
|
-
width: 560,
|
|
671
|
-
text: '描边标题 Outline',
|
|
672
|
-
fontFamily: 'sans-serif',
|
|
673
|
-
fontSize: 56,
|
|
674
|
-
fontWeight: 'bold',
|
|
675
|
-
lineHeight: 1.16,
|
|
676
|
-
stroke: '#c03030',
|
|
677
|
-
strokeWidth: 8,
|
|
678
|
-
paintFirst: 'fill'
|
|
679
|
-
},
|
|
680
|
-
{
|
|
681
|
-
...base,
|
|
682
|
-
id: 'k1',
|
|
683
|
-
left: 640,
|
|
684
|
-
top: 30,
|
|
685
|
-
width: 560,
|
|
686
|
-
text: 'Stroke First 外描边',
|
|
687
|
-
fontFamily: 'sans-serif',
|
|
688
|
-
fontSize: 56,
|
|
689
|
-
fontWeight: 'bold',
|
|
690
|
-
lineHeight: 1.16,
|
|
691
|
-
stroke: '#c03030',
|
|
692
|
-
strokeWidth: 8,
|
|
693
|
-
paintFirst: 'stroke'
|
|
694
|
-
},
|
|
695
|
-
{
|
|
696
|
-
...base,
|
|
697
|
-
id: 'k2',
|
|
698
|
-
left: 40,
|
|
699
|
-
top: 160,
|
|
700
|
-
width: 560,
|
|
701
|
-
text: '纯描边 Outline only',
|
|
702
|
-
fontFamily: 'serif',
|
|
703
|
-
fontSize: 48,
|
|
704
|
-
lineHeight: 1.16,
|
|
705
|
-
fill: '',
|
|
706
|
-
stroke: '#2060c0',
|
|
707
|
-
strokeWidth: 3
|
|
708
|
-
},
|
|
709
|
-
{
|
|
710
|
-
...base,
|
|
711
|
-
id: 'k3',
|
|
712
|
-
left: 640,
|
|
713
|
-
top: 160,
|
|
714
|
-
width: 560,
|
|
715
|
-
text: 'Per char stroke 逐字描边',
|
|
716
|
-
fontFamily: 'sans-serif',
|
|
717
|
-
fontSize: 40,
|
|
718
|
-
lineHeight: 1.3,
|
|
719
|
-
fill: '#202020',
|
|
720
|
-
stroke: '#104010',
|
|
721
|
-
strokeWidth: 3,
|
|
722
|
-
// 索引对应 "Per char stroke 逐字描边":0-2='Per'、4-7='char' 加粗描边
|
|
723
|
-
styles: {
|
|
724
|
-
0: {
|
|
725
|
-
0: { strokeWidth: 12, stroke: '#c03030' },
|
|
726
|
-
1: { strokeWidth: 12, stroke: '#c03030' },
|
|
727
|
-
2: { strokeWidth: 12, stroke: '#c03030' },
|
|
728
|
-
4: { stroke: '#7030a0', strokeWidth: 8 },
|
|
729
|
-
5: { stroke: '#7030a0', strokeWidth: 8 },
|
|
730
|
-
6: { stroke: '#7030a0', strokeWidth: 8 },
|
|
731
|
-
7: { stroke: '#7030a0', strokeWidth: 8 }
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
},
|
|
735
|
-
{
|
|
736
|
-
...base,
|
|
737
|
-
id: 'k4',
|
|
738
|
-
left: 40,
|
|
739
|
-
top: 290,
|
|
740
|
-
width: 700,
|
|
741
|
-
text: 'default width 缺省线宽',
|
|
742
|
-
fontFamily: 'monospace',
|
|
743
|
-
fontSize: 44,
|
|
744
|
-
lineHeight: 1.16,
|
|
745
|
-
fill: '#303030',
|
|
746
|
-
stroke: '#704080'
|
|
747
|
-
},
|
|
748
|
-
{
|
|
749
|
-
...base,
|
|
750
|
-
id: 'k5',
|
|
751
|
-
left: 640,
|
|
752
|
-
top: 300,
|
|
753
|
-
width: 560,
|
|
754
|
-
text: 'no stroke, width 6 只有宽度',
|
|
755
|
-
fontFamily: 'sans-serif',
|
|
756
|
-
fontSize: 40,
|
|
757
|
-
lineHeight: 1.16,
|
|
758
|
-
fill: '#202020',
|
|
759
|
-
strokeWidth: 6
|
|
760
|
-
},
|
|
761
|
-
{
|
|
762
|
-
...base,
|
|
763
|
-
id: 'k6',
|
|
764
|
-
left: 40,
|
|
765
|
-
top: 420,
|
|
766
|
-
width: 700,
|
|
767
|
-
text: '带缩放与角度 描边',
|
|
768
|
-
fontFamily: 'sans-serif',
|
|
769
|
-
fontSize: 44,
|
|
770
|
-
fontWeight: 'bold',
|
|
771
|
-
lineHeight: 1.16,
|
|
772
|
-
fill: '#1a1a1a',
|
|
773
|
-
stroke: '#e0a020',
|
|
774
|
-
strokeWidth: 5,
|
|
775
|
-
scaleX: 1.2,
|
|
776
|
-
scaleY: 0.9,
|
|
777
|
-
angle: 8
|
|
778
|
-
},
|
|
779
|
-
{
|
|
780
|
-
...base,
|
|
781
|
-
id: 'k7',
|
|
782
|
-
left: 640,
|
|
783
|
-
top: 440,
|
|
784
|
-
width: 560,
|
|
785
|
-
text: '两行描边文本\nsecond line',
|
|
786
|
-
fontFamily: 'sans-serif',
|
|
787
|
-
fontSize: 36,
|
|
788
|
-
lineHeight: 1.3,
|
|
789
|
-
fill: '#202020',
|
|
790
|
-
stroke: 'rgba(16, 96, 64, 0.6)',
|
|
791
|
-
strokeWidth: 2.5
|
|
792
|
-
}
|
|
793
|
-
];
|
|
794
|
-
};
|
|
795
|
-
/**
|
|
796
|
-
* 装饰线文本场景(Phase 2 P2-4):underline / overline / linethrough。
|
|
797
|
-
*
|
|
798
|
-
* 覆盖的语义分层:
|
|
799
|
-
* - d0/d1/d2:对象级三线型各一(y 偏移系数 0.1 / −0.28167 / −0.81333);
|
|
800
|
-
* - d3:逐字 underline 开关 + 逐字 fill(装饰色跟 fill、fill 变化断段);
|
|
801
|
-
* - d4:对象级 on + 逐字 textDecorationThickness 覆写(线宽 = 对象 fontSize × ‰);
|
|
802
|
-
* - d5:charSpacing + underline(行末 flush 宽度扣除一次对象级 spacing);
|
|
803
|
-
* - d6:逐字 fontSize 混排 + underline(run 按 size 断段、y 用段首字号、
|
|
804
|
-
* 线宽仍按对象 fontSize);
|
|
805
|
-
* - d7:三线全开 + scale/角度 + 多行(变换链 + 逐行独立 run)。
|
|
806
|
-
*
|
|
807
|
-
* 刻意不带 textBackgroundColor:布局 parity 走 fillRect 探针对拍,背景高亮的
|
|
808
|
-
* fillRect 会混入记录(探针按类型隔离已排除字形 fillText,背景属第三来源)。
|
|
809
|
-
* deltaY 不进场景(引擎暂不支持逐字 deltaY)。
|
|
810
|
-
*/
|
|
811
|
-
export const makeDecorationTextScene = () => {
|
|
812
|
-
const base = {
|
|
813
|
-
type: 'textbox',
|
|
814
|
-
scaleX: 1,
|
|
815
|
-
scaleY: 1,
|
|
816
|
-
angle: 0,
|
|
817
|
-
originX: 'left',
|
|
818
|
-
originY: 'top',
|
|
819
|
-
opacity: 1,
|
|
820
|
-
strokeWidth: 0,
|
|
821
|
-
visible: true,
|
|
822
|
-
fill: '#1a1a1a'
|
|
823
|
-
};
|
|
824
|
-
return [
|
|
825
|
-
{
|
|
826
|
-
...base,
|
|
827
|
-
id: 'd0',
|
|
828
|
-
left: 40,
|
|
829
|
-
top: 30,
|
|
830
|
-
width: 560,
|
|
831
|
-
text: '下划线标题 Underline',
|
|
832
|
-
fontFamily: 'sans-serif',
|
|
833
|
-
fontSize: 52,
|
|
834
|
-
fontWeight: 'bold',
|
|
835
|
-
lineHeight: 1.16,
|
|
836
|
-
underline: true
|
|
837
|
-
},
|
|
838
|
-
{
|
|
839
|
-
...base,
|
|
840
|
-
id: 'd1',
|
|
841
|
-
left: 640,
|
|
842
|
-
top: 30,
|
|
843
|
-
width: 560,
|
|
844
|
-
text: '删除线 Strikethrough',
|
|
845
|
-
fontFamily: 'serif',
|
|
846
|
-
fontSize: 46,
|
|
847
|
-
lineHeight: 1.16,
|
|
848
|
-
linethrough: true,
|
|
849
|
-
fill: '#803030'
|
|
850
|
-
},
|
|
851
|
-
{
|
|
852
|
-
...base,
|
|
853
|
-
id: 'd2',
|
|
854
|
-
left: 40,
|
|
855
|
-
top: 160,
|
|
856
|
-
width: 560,
|
|
857
|
-
text: '上划线 Overline',
|
|
858
|
-
fontFamily: 'monospace',
|
|
859
|
-
fontSize: 40,
|
|
860
|
-
lineHeight: 1.16,
|
|
861
|
-
overline: true,
|
|
862
|
-
fill: '#206080'
|
|
863
|
-
},
|
|
864
|
-
{
|
|
865
|
-
...base,
|
|
866
|
-
id: 'd3',
|
|
867
|
-
left: 640,
|
|
868
|
-
top: 160,
|
|
869
|
-
width: 620,
|
|
870
|
-
text: 'Per char style 装饰线',
|
|
871
|
-
fontFamily: 'sans-serif',
|
|
872
|
-
fontSize: 40,
|
|
873
|
-
lineHeight: 1.3,
|
|
874
|
-
fill: '#303030',
|
|
875
|
-
// 索引对应 "Per char style 装饰线":0-2='Per'、4-7='char'、9-13='style'、15-17='装饰线'
|
|
876
|
-
styles: {
|
|
877
|
-
0: {
|
|
878
|
-
0: { underline: true, fill: '#c03030' },
|
|
879
|
-
1: { underline: true, fill: '#c03030' },
|
|
880
|
-
2: { underline: true, fill: '#c03030' },
|
|
881
|
-
4: { underline: true, fill: '#2060c0' },
|
|
882
|
-
5: { underline: true, fill: '#2060c0' },
|
|
883
|
-
6: { underline: true, fill: '#2060c0' },
|
|
884
|
-
7: { underline: true, fill: '#2060c0' },
|
|
885
|
-
9: { underline: true },
|
|
886
|
-
10: { underline: true },
|
|
887
|
-
11: { underline: true },
|
|
888
|
-
12: { underline: true },
|
|
889
|
-
13: { underline: true },
|
|
890
|
-
15: { underline: true, fill: '#106040' },
|
|
891
|
-
16: { underline: true, fill: '#106040' },
|
|
892
|
-
17: { underline: true, fill: '#106040' }
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
},
|
|
896
|
-
{
|
|
897
|
-
...base,
|
|
898
|
-
id: 'd4',
|
|
899
|
-
left: 40,
|
|
900
|
-
top: 300,
|
|
901
|
-
width: 620,
|
|
902
|
-
text: '粗线 Thick 线宽覆写',
|
|
903
|
-
fontFamily: 'sans-serif',
|
|
904
|
-
fontSize: 44,
|
|
905
|
-
lineHeight: 1.2,
|
|
906
|
-
underline: true,
|
|
907
|
-
fill: '#404040',
|
|
908
|
-
// 索引对应 "粗线 Thick 线宽覆写":0-1='粗线'(250‰ 粗线)、3-7='Thick'(200‰)
|
|
909
|
-
styles: {
|
|
910
|
-
0: {
|
|
911
|
-
0: { textDecorationThickness: 250 },
|
|
912
|
-
1: { textDecorationThickness: 250 },
|
|
913
|
-
3: { textDecorationThickness: 200 },
|
|
914
|
-
4: { textDecorationThickness: 200 },
|
|
915
|
-
5: { textDecorationThickness: 200 },
|
|
916
|
-
6: { textDecorationThickness: 200 },
|
|
917
|
-
7: { textDecorationThickness: 200 }
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
},
|
|
921
|
-
{
|
|
922
|
-
...base,
|
|
923
|
-
id: 'd5',
|
|
924
|
-
left: 640,
|
|
925
|
-
top: 320,
|
|
926
|
-
width: 560,
|
|
927
|
-
text: '字距 Spacing 下划线',
|
|
928
|
-
fontFamily: 'serif',
|
|
929
|
-
fontSize: 40,
|
|
930
|
-
lineHeight: 1.16,
|
|
931
|
-
charSpacing: 80,
|
|
932
|
-
underline: true,
|
|
933
|
-
fill: '#505030'
|
|
934
|
-
},
|
|
935
|
-
{
|
|
936
|
-
...base,
|
|
937
|
-
id: 'd6',
|
|
938
|
-
left: 40,
|
|
939
|
-
top: 430,
|
|
940
|
-
width: 620,
|
|
941
|
-
text: 'Mixed sizes 装饰线',
|
|
942
|
-
fontFamily: 'sans-serif',
|
|
943
|
-
fontSize: 24,
|
|
944
|
-
lineHeight: 1.35,
|
|
945
|
-
underline: true,
|
|
946
|
-
fill: '#303030',
|
|
947
|
-
// 索引对应 "Mixed sizes 装饰线":0-4='Mixed'(fontSize 44)
|
|
948
|
-
styles: {
|
|
949
|
-
0: {
|
|
950
|
-
0: { fontSize: 44 },
|
|
951
|
-
1: { fontSize: 44 },
|
|
952
|
-
2: { fontSize: 44 },
|
|
953
|
-
3: { fontSize: 44 },
|
|
954
|
-
4: { fontSize: 44 }
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
},
|
|
958
|
-
{
|
|
959
|
-
...base,
|
|
960
|
-
id: 'd7',
|
|
961
|
-
left: 640,
|
|
962
|
-
top: 450,
|
|
963
|
-
width: 560,
|
|
964
|
-
text: '三线全开\nsecond line',
|
|
965
|
-
fontFamily: 'sans-serif',
|
|
966
|
-
fontSize: 34,
|
|
967
|
-
lineHeight: 1.3,
|
|
968
|
-
underline: true,
|
|
969
|
-
overline: true,
|
|
970
|
-
linethrough: true,
|
|
971
|
-
fill: '#402050',
|
|
972
|
-
scaleX: 1.15,
|
|
973
|
-
scaleY: 0.95,
|
|
974
|
-
angle: 6
|
|
975
|
-
}
|
|
976
|
-
];
|
|
977
|
-
};
|
|
978
|
-
/**
|
|
979
|
-
* 渐变填充场景(Phase 3 P3-3):linear/radial × rect/形状 + 坐标系变体。
|
|
980
|
-
*
|
|
981
|
-
* 覆盖的语义分层(渐变坐标原点在对象左上角、pixels 系单位为对象未变换像素):
|
|
982
|
-
* - g0/g1:linear 水平/垂直(端点轴投影的 t);
|
|
983
|
-
* - g2:linear 对角 + 对象带角度与 scale(变换链下渐变随对象本地空间);
|
|
984
|
-
* - g3:radial 同心(r1=0 → t=|q−c|/r2 的闭式根验证面);
|
|
985
|
-
* - g4:radial 非同心(x1≠x2,圆族二次方程的判别式路径);
|
|
986
|
-
* - g5:percentage 系(coords 为 0..1 分数,合成矩阵多乘 scale(w,h));
|
|
987
|
-
* - g6:linear 多 stop + 中段透明 stop(预乘空间插值 vs 直通的区分度);
|
|
988
|
-
* - g7:凹 L 形 radial(三角化网格的逐片元渐变);
|
|
989
|
-
* - g8:gradientTransform 旋转 30°(合成矩阵第三段);
|
|
990
|
-
* - g9:offsetX/offsetY 平移渐变 + 对象半透明(globalAlpha 乘法)。
|
|
991
|
-
*
|
|
992
|
-
* 文本渐变不进场景(引擎字形管线暂以首 stop 近似,P3-3 已知缺口)。
|
|
993
|
-
*/
|
|
994
|
-
export const makeGradientScene = () => {
|
|
995
|
-
const base = {
|
|
996
|
-
// 占位(每个条目各自覆写 type)
|
|
997
|
-
type: 'rect',
|
|
998
|
-
scaleX: 1,
|
|
999
|
-
scaleY: 1,
|
|
1000
|
-
angle: 0,
|
|
1001
|
-
originX: 'left',
|
|
1002
|
-
originY: 'top',
|
|
1003
|
-
opacity: 1,
|
|
1004
|
-
strokeWidth: 0,
|
|
1005
|
-
visible: true
|
|
1006
|
-
};
|
|
1007
|
-
const lin = (x1, y1, x2, y2, stops, extra = {}) => ({
|
|
1008
|
-
type: 'linear',
|
|
1009
|
-
coords: { x1, y1, x2, y2 },
|
|
1010
|
-
colorStops: stops.map(([offset, color]) => ({ offset, color })),
|
|
1011
|
-
offsetX: 0,
|
|
1012
|
-
offsetY: 0,
|
|
1013
|
-
gradientUnits: 'pixels',
|
|
1014
|
-
...extra
|
|
1015
|
-
});
|
|
1016
|
-
const rad = (x1, y1, r1, x2, y2, r2, stops) => ({
|
|
1017
|
-
type: 'radial',
|
|
1018
|
-
coords: { x1, y1, r1, x2, y2, r2 },
|
|
1019
|
-
colorStops: stops.map(([offset, color]) => ({ offset, color })),
|
|
1020
|
-
offsetX: 0,
|
|
1021
|
-
offsetY: 0,
|
|
1022
|
-
gradientUnits: 'pixels'
|
|
1023
|
-
});
|
|
1024
|
-
return [
|
|
1025
|
-
{
|
|
1026
|
-
...base,
|
|
1027
|
-
id: 'g0',
|
|
1028
|
-
left: 60,
|
|
1029
|
-
top: 40,
|
|
1030
|
-
width: 240,
|
|
1031
|
-
height: 140,
|
|
1032
|
-
fill: lin(0, 0, 240, 0, [
|
|
1033
|
-
[0, '#c03030'],
|
|
1034
|
-
[1, '#e0c030']
|
|
1035
|
-
])
|
|
1036
|
-
},
|
|
1037
|
-
{
|
|
1038
|
-
...base,
|
|
1039
|
-
id: 'g1',
|
|
1040
|
-
left: 340,
|
|
1041
|
-
top: 40,
|
|
1042
|
-
width: 240,
|
|
1043
|
-
height: 140,
|
|
1044
|
-
fill: lin(0, 0, 0, 140, [
|
|
1045
|
-
[0, '#2050c0'],
|
|
1046
|
-
[0.5, '#e8e8f0'],
|
|
1047
|
-
[1, '#30a050']
|
|
1048
|
-
])
|
|
1049
|
-
},
|
|
1050
|
-
{
|
|
1051
|
-
...base,
|
|
1052
|
-
id: 'g2',
|
|
1053
|
-
left: 620,
|
|
1054
|
-
top: 40,
|
|
1055
|
-
width: 240,
|
|
1056
|
-
height: 140,
|
|
1057
|
-
angle: 20,
|
|
1058
|
-
scaleX: 1.2,
|
|
1059
|
-
scaleY: 0.9,
|
|
1060
|
-
fill: lin(0, 0, 240, 140, [
|
|
1061
|
-
[0, '#7030a0'],
|
|
1062
|
-
[1, '#30b0b0']
|
|
1063
|
-
])
|
|
1064
|
-
},
|
|
1065
|
-
{
|
|
1066
|
-
...base,
|
|
1067
|
-
id: 'g3',
|
|
1068
|
-
type: 'ellipse',
|
|
1069
|
-
left: 920,
|
|
1070
|
-
top: 50,
|
|
1071
|
-
rx: 120,
|
|
1072
|
-
ry: 80,
|
|
1073
|
-
fill: rad(120, 80, 0, 120, 80, 110, [
|
|
1074
|
-
[0, '#e06030'],
|
|
1075
|
-
[1, '#f0e0d0']
|
|
1076
|
-
])
|
|
1077
|
-
},
|
|
1078
|
-
{
|
|
1079
|
-
...base,
|
|
1080
|
-
id: 'g4',
|
|
1081
|
-
type: 'circle',
|
|
1082
|
-
left: 60,
|
|
1083
|
-
top: 220,
|
|
1084
|
-
radius: 90,
|
|
1085
|
-
fill: rad(60, 90, 10, 95, 60, 90, [
|
|
1086
|
-
[0, '#2060c0'],
|
|
1087
|
-
[1, '#d0e0f0']
|
|
1088
|
-
])
|
|
1089
|
-
},
|
|
1090
|
-
{
|
|
1091
|
-
...base,
|
|
1092
|
-
id: 'g5',
|
|
1093
|
-
left: 280,
|
|
1094
|
-
top: 220,
|
|
1095
|
-
width: 240,
|
|
1096
|
-
height: 160,
|
|
1097
|
-
fill: {
|
|
1098
|
-
type: 'linear',
|
|
1099
|
-
coords: { x1: 0, y1: 0, x2: 1, y2: 1 },
|
|
1100
|
-
colorStops: [
|
|
1101
|
-
{ offset: 0, color: '#108060' },
|
|
1102
|
-
{ offset: 1, color: '#e0a020' }
|
|
1103
|
-
],
|
|
1104
|
-
offsetX: 0,
|
|
1105
|
-
offsetY: 0,
|
|
1106
|
-
gradientUnits: 'percentage'
|
|
1107
|
-
}
|
|
1108
|
-
},
|
|
1109
|
-
{
|
|
1110
|
-
...base,
|
|
1111
|
-
id: 'g6',
|
|
1112
|
-
left: 560,
|
|
1113
|
-
top: 220,
|
|
1114
|
-
width: 280,
|
|
1115
|
-
height: 160,
|
|
1116
|
-
fill: lin(0, 0, 280, 0, [
|
|
1117
|
-
[0, '#c02060'],
|
|
1118
|
-
[0.45, 'rgba(255,200,80,0.25)'],
|
|
1119
|
-
[1, '#2060a0']
|
|
1120
|
-
])
|
|
1121
|
-
},
|
|
1122
|
-
{
|
|
1123
|
-
...base,
|
|
1124
|
-
id: 'g7',
|
|
1125
|
-
type: 'polygon',
|
|
1126
|
-
left: 880,
|
|
1127
|
-
top: 210,
|
|
1128
|
-
points: [
|
|
1129
|
-
{ x: 0, y: 0 },
|
|
1130
|
-
{ x: 180, y: 0 },
|
|
1131
|
-
{ x: 180, y: 60 },
|
|
1132
|
-
{ x: 60, y: 60 },
|
|
1133
|
-
{ x: 60, y: 170 },
|
|
1134
|
-
{ x: 0, y: 170 }
|
|
1135
|
-
],
|
|
1136
|
-
fill: rad(90, 85, 0, 90, 85, 130, [
|
|
1137
|
-
[0, '#a03070'],
|
|
1138
|
-
[1, '#3070a0']
|
|
1139
|
-
])
|
|
1140
|
-
},
|
|
1141
|
-
{
|
|
1142
|
-
...base,
|
|
1143
|
-
id: 'g8',
|
|
1144
|
-
left: 60,
|
|
1145
|
-
top: 430,
|
|
1146
|
-
width: 260,
|
|
1147
|
-
height: 170,
|
|
1148
|
-
fill: lin(0, 0, 260, 0, [
|
|
1149
|
-
[0, '#b08020'],
|
|
1150
|
-
[1, '#40b060']
|
|
1151
|
-
], {
|
|
1152
|
-
gradientTransform: [Math.cos((30 * Math.PI) / 180), Math.sin((30 * Math.PI) / 180), -Math.sin((30 * Math.PI) / 180), Math.cos((30 * Math.PI) / 180), 0, 0]
|
|
1153
|
-
})
|
|
1154
|
-
},
|
|
1155
|
-
{
|
|
1156
|
-
...base,
|
|
1157
|
-
id: 'g9',
|
|
1158
|
-
left: 360,
|
|
1159
|
-
top: 430,
|
|
1160
|
-
width: 260,
|
|
1161
|
-
height: 170,
|
|
1162
|
-
opacity: 0.8,
|
|
1163
|
-
fill: lin(0, 0, 260, 0, [
|
|
1164
|
-
[0, '#4040c0'],
|
|
1165
|
-
[1, '#c04040']
|
|
1166
|
-
], { offsetX: 60, offsetY: 40 })
|
|
1167
|
-
}
|
|
1168
|
-
];
|
|
1169
|
-
};
|
|
1170
|
-
/**
|
|
1171
|
-
* 图案填充场景(Phase 3 P3-3b):pattern × repeat 语义 × rect/形状。
|
|
1172
|
-
*
|
|
1173
|
-
* tile 用本地打包素材(与图片场景同源,1:1 尺度下 canvas pattern 与 GL REPEAT
|
|
1174
|
-
* 采样都近乎逐像素复制);patternTransform 旋转用例改用平滑 SVG 渐变 data URL
|
|
1175
|
-
* tile(硬边素材的旋转重采样核差异会铺满 tile,与图案语义本身无关)。
|
|
1176
|
-
* 差异集中在:旋转重采样、椭圆/凹形轮廓 AA、tile 边界的亚像素定位。
|
|
1177
|
-
* 覆盖:repeat/repeat-x/repeat-y/no-repeat(单次轴 tile 外透明的遮罩语义)、
|
|
1178
|
-
* patternTransform 旋转、offsetX/offsetY、mesh 管线(椭圆/凹多边形)。
|
|
1179
|
-
* 文本图案不进场景(引擎字形管线暂以黑近似,P3-3 已知缺口)。
|
|
1180
|
-
*/
|
|
1181
|
-
export const makePatternScene = () => {
|
|
1182
|
-
const base = {
|
|
1183
|
-
type: 'rect',
|
|
1184
|
-
scaleX: 1,
|
|
1185
|
-
scaleY: 1,
|
|
1186
|
-
angle: 0,
|
|
1187
|
-
originX: 'left',
|
|
1188
|
-
originY: 'top',
|
|
1189
|
-
opacity: 1,
|
|
1190
|
-
strokeWidth: 0,
|
|
1191
|
-
visible: true
|
|
1192
|
-
};
|
|
1193
|
-
const tileA = assetUrl('../../assets/images/nasty_fabric.png'); // 198×200 织物
|
|
1194
|
-
const tileB = assetUrl('../../assets/images/greyfloral.png'); // 150×124 灰花卉
|
|
1195
|
-
// repeat 变体按应用图案选择器的真实形态给 patternTransform——
|
|
1196
|
-
// 裸 no-repeat 自然尺寸贴图在 canvas 语义下只填左上一角(与 fabric 逐像素一致,
|
|
1197
|
-
// 但观感像「选框与内容错位」);裸语义的轴向遮罩由 pattern.spec 单测覆盖。
|
|
1198
|
-
// 缩放公式同 ColorPicker.generatePattern:适应=min / 贴合=max,等比居中(ratio=1)
|
|
1199
|
-
const fitTileB = (elW, elH, mode) => {
|
|
1200
|
-
const s = mode === 'contain' ? Math.min(elW / 150, elH / 124) : Math.max(elW / 150, elH / 124);
|
|
1201
|
-
return [s, 0, 0, s, (elW - 150 * s) / 2, (elH - 124 * s) / 2];
|
|
1202
|
-
};
|
|
1203
|
-
// 平滑渐变 tile(80×80,旋转重采样安全):SVG data URL,两侧同源栅格化
|
|
1204
|
-
const smoothTile = `data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80"><defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#3f7fbf"/><stop offset="1" stop-color="#e0c060"/></linearGradient></defs><rect width="80" height="80" fill="url(#g)"/></svg>')}`;
|
|
1205
|
-
const pat = (source, extra = {}) => ({
|
|
1206
|
-
type: 'pattern',
|
|
1207
|
-
source,
|
|
1208
|
-
repeat: 'repeat',
|
|
1209
|
-
offsetX: 0,
|
|
1210
|
-
offsetY: 0,
|
|
1211
|
-
patternTransform: null,
|
|
1212
|
-
...extra
|
|
1213
|
-
});
|
|
1214
|
-
return [
|
|
1215
|
-
{ ...base, id: 'p0', left: 60, top: 40, width: 280, height: 160, fill: pat(tileA) },
|
|
1216
|
-
{ ...base, id: 'p1', left: 380, top: 40, width: 300, height: 200, fill: pat(tileB) },
|
|
1217
|
-
// repeat-x:tile 纵向缩放到盒高(单次轴恰好满高)+ 横向平铺——遮罩语义在满高边界上
|
|
1218
|
-
{ ...base, id: 'p2', left: 720, top: 40, width: 280, height: 160, fill: pat(tileA, { repeat: 'repeat-x', patternTransform: [160 / 200, 0, 0, 160 / 200, 0, 0] }) },
|
|
1219
|
-
// repeat-y:tile 横向缩放到盒宽(单次轴恰好满宽)+ 纵向平铺
|
|
1220
|
-
{ ...base, id: 'p3', left: 60, top: 240, width: 280, height: 160, fill: pat(tileA, { repeat: 'repeat-y', patternTransform: [280 / 198, 0, 0, 280 / 198, 0, 0] }) },
|
|
1221
|
-
// no-repeat:贴合(cover)式变换铺满盒(应用「贴合」选项同形态),双单次轴遮罩
|
|
1222
|
-
{ ...base, id: 'p4', left: 380, top: 280, width: 300, height: 180, fill: pat(tileB, { repeat: 'no-repeat', patternTransform: fitTileB(300, 180, 'cover') }) },
|
|
1223
|
-
{
|
|
1224
|
-
...base,
|
|
1225
|
-
id: 'p5',
|
|
1226
|
-
left: 720,
|
|
1227
|
-
top: 240,
|
|
1228
|
-
width: 280,
|
|
1229
|
-
height: 180,
|
|
1230
|
-
fill: pat(smoothTile, { patternTransform: [Math.cos((20 * Math.PI) / 180), Math.sin((20 * Math.PI) / 180), -Math.sin((20 * Math.PI) / 180), Math.cos((20 * Math.PI) / 180), 0, 0] })
|
|
1231
|
-
},
|
|
1232
|
-
{ ...base, id: 'p6', type: 'ellipse', left: 60, top: 440, rx: 130, ry: 85, fill: pat(tileB) },
|
|
1233
|
-
{
|
|
1234
|
-
...base,
|
|
1235
|
-
id: 'p7',
|
|
1236
|
-
type: 'polygon',
|
|
1237
|
-
left: 340,
|
|
1238
|
-
top: 470,
|
|
1239
|
-
points: [
|
|
1240
|
-
{ x: 0, y: 0 },
|
|
1241
|
-
{ x: 200, y: 0 },
|
|
1242
|
-
{ x: 200, y: 60 },
|
|
1243
|
-
{ x: 70, y: 60 },
|
|
1244
|
-
{ x: 70, y: 170 },
|
|
1245
|
-
{ x: 0, y: 170 }
|
|
1246
|
-
],
|
|
1247
|
-
fill: pat(tileA, { offsetX: 30, offsetY: 20 })
|
|
1248
|
-
}
|
|
1249
|
-
];
|
|
1250
|
-
};
|
|
1251
|
-
/**
|
|
1252
|
-
* 阴影场景(Phase 3 P3-4):shadow × 对象族 × 变换链。
|
|
1253
|
-
*
|
|
1254
|
-
* 覆盖:blur+offset 组合 / 纯 offset 硬阴影 / 彩色半透明阴影色 / 旋转+缩放对象
|
|
1255
|
-
* (offset 沿画布轴不随对象旋转——canvas 设备空间语义)/ 椭圆与凹多边形 /
|
|
1256
|
-
* 位图 alpha 剪影 / 文本逐字剪影 / nonScaling / 阴影×渐变填充叠加。
|
|
1257
|
-
* 已知近似(场景规避):半透明填充对象的阴影强度按源 alpha 衰减(烘焙剪影
|
|
1258
|
-
* 恒不透明);affectStroke 描边阴影不在此列(形状描边属 P3-2)。
|
|
1259
|
-
*/
|
|
1260
|
-
export const makeShadowScene = () => {
|
|
1261
|
-
const base = {
|
|
1262
|
-
type: 'rect',
|
|
1263
|
-
scaleX: 1,
|
|
1264
|
-
scaleY: 1,
|
|
1265
|
-
angle: 0,
|
|
1266
|
-
originX: 'left',
|
|
1267
|
-
originY: 'top',
|
|
1268
|
-
opacity: 1,
|
|
1269
|
-
strokeWidth: 0,
|
|
1270
|
-
visible: true,
|
|
1271
|
-
fill: '#e8e0d0'
|
|
1272
|
-
};
|
|
1273
|
-
const shadow = (color, blur, offsetX, offsetY, extra = {}) => ({
|
|
1274
|
-
color,
|
|
1275
|
-
blur,
|
|
1276
|
-
offsetX,
|
|
1277
|
-
offsetY,
|
|
1278
|
-
affectStroke: false,
|
|
1279
|
-
nonScaling: false,
|
|
1280
|
-
...extra
|
|
1281
|
-
});
|
|
1282
|
-
return [
|
|
1283
|
-
{ ...base, id: 'sh0', left: 60, top: 40, width: 240, height: 140, fill: '#d0c8b8', shadow: shadow('rgba(40,40,60,0.45)', 12, 10, 10) },
|
|
1284
|
-
{ ...base, id: 'sh1', left: 380, top: 40, width: 240, height: 140, fill: '#c8d8c0', shadow: shadow('rgba(30,60,30,0.5)', 0, 14, 8) },
|
|
1285
|
-
{ ...base, id: 'sh2', left: 700, top: 40, width: 240, height: 140, fill: '#f0f0f0', shadow: shadow('rgba(160,60,200,0.5)', 16, -8, 12) },
|
|
1286
|
-
{
|
|
1287
|
-
...base,
|
|
1288
|
-
id: 'sh3',
|
|
1289
|
-
left: 1020,
|
|
1290
|
-
top: 60,
|
|
1291
|
-
width: 220,
|
|
1292
|
-
height: 150,
|
|
1293
|
-
angle: 30,
|
|
1294
|
-
scaleX: 1.2,
|
|
1295
|
-
scaleY: 0.9,
|
|
1296
|
-
fill: '#d8ccc0',
|
|
1297
|
-
shadow: shadow('rgba(60,50,40,0.5)', 10, 12, 12)
|
|
1298
|
-
},
|
|
1299
|
-
{ ...base, id: 'sh4', type: 'ellipse', left: 60, top: 240, rx: 120, ry: 78, fill: '#c0cad8', shadow: shadow('rgba(30,40,80,0.45)', 14, 8, 10) },
|
|
1300
|
-
{
|
|
1301
|
-
...base,
|
|
1302
|
-
id: 'sh5',
|
|
1303
|
-
type: 'polygon',
|
|
1304
|
-
left: 320,
|
|
1305
|
-
top: 250,
|
|
1306
|
-
points: [
|
|
1307
|
-
{ x: 0, y: 0 },
|
|
1308
|
-
{ x: 180, y: 0 },
|
|
1309
|
-
{ x: 180, y: 60 },
|
|
1310
|
-
{ x: 60, y: 60 },
|
|
1311
|
-
{ x: 60, y: 170 },
|
|
1312
|
-
{ x: 0, y: 170 }
|
|
1313
|
-
],
|
|
1314
|
-
fill: '#d0d0c0',
|
|
1315
|
-
shadow: shadow('rgba(60,60,30,0.45)', 12, 10, 10)
|
|
1316
|
-
},
|
|
1317
|
-
{
|
|
1318
|
-
...base,
|
|
1319
|
-
id: 'sh6',
|
|
1320
|
-
type: 'image',
|
|
1321
|
-
left: 620,
|
|
1322
|
-
top: 250,
|
|
1323
|
-
src: assetUrl('../../assets/images/nasty_fabric.png'),
|
|
1324
|
-
shadow: shadow('rgba(40,30,60,0.5)', 12, 10, 10)
|
|
1325
|
-
},
|
|
1326
|
-
{
|
|
1327
|
-
...base,
|
|
1328
|
-
id: 'sh7',
|
|
1329
|
-
type: 'textbox',
|
|
1330
|
-
left: 60,
|
|
1331
|
-
top: 470,
|
|
1332
|
-
width: 420,
|
|
1333
|
-
text: '阴影文本 Shadow text 逐字剪影',
|
|
1334
|
-
fontFamily: 'sans-serif',
|
|
1335
|
-
fontSize: 44,
|
|
1336
|
-
fontWeight: 'bold',
|
|
1337
|
-
fill: '#303040',
|
|
1338
|
-
lineHeight: 1.16,
|
|
1339
|
-
shadow: shadow('rgba(80,90,160,0.5)', 8, 6, 8)
|
|
1340
|
-
},
|
|
1341
|
-
{
|
|
1342
|
-
...base,
|
|
1343
|
-
id: 'sh8',
|
|
1344
|
-
left: 540,
|
|
1345
|
-
top: 470,
|
|
1346
|
-
width: 240,
|
|
1347
|
-
height: 150,
|
|
1348
|
-
scaleX: 1.8,
|
|
1349
|
-
scaleY: 1.4,
|
|
1350
|
-
fill: '#e0d8e8',
|
|
1351
|
-
shadow: shadow('rgba(60,40,60,0.5)', 10, 10, 10, { nonScaling: true })
|
|
1352
|
-
},
|
|
1353
|
-
{
|
|
1354
|
-
...base,
|
|
1355
|
-
id: 'sh9',
|
|
1356
|
-
left: 880,
|
|
1357
|
-
top: 470,
|
|
1358
|
-
width: 280,
|
|
1359
|
-
height: 170,
|
|
1360
|
-
fill: {
|
|
1361
|
-
type: 'linear',
|
|
1362
|
-
coords: { x1: 0, y1: 0, x2: 280, y2: 0 },
|
|
1363
|
-
colorStops: [
|
|
1364
|
-
{ offset: 0, color: '#c06060' },
|
|
1365
|
-
{ offset: 1, color: '#6060c0' }
|
|
1366
|
-
],
|
|
1367
|
-
offsetX: 0,
|
|
1368
|
-
offsetY: 0,
|
|
1369
|
-
gradientUnits: 'pixels'
|
|
1370
|
-
},
|
|
1371
|
-
shadow: shadow('rgba(40,40,40,0.5)', 14, 10, 12)
|
|
1372
|
-
}
|
|
1373
|
-
];
|
|
1374
|
-
};
|
|
1375
|
-
/**
|
|
1376
|
-
* 图片族 PSD 效果场景(Phase 3 P3-5a):dropShadow / solidFill(fillType 0)。
|
|
1377
|
-
*
|
|
1378
|
-
* 参考侧为**应用侧 FabricImage**(effects 是应用定制语义,clean fabric 不认)。
|
|
1379
|
-
* 覆盖:单层/多层投影(累积语义)、纯 offset 硬影、彩色影、旋转+缩放变换链、
|
|
1380
|
-
* solidFill 纯色叠加(图像 alpha 遮罩)、影+填充组合、顶层 disabled(main 不
|
|
1381
|
-
* 检查该开关、逐效果 enabled 照常生效——对齐 ground truth 的口径锁)。
|
|
1382
|
-
* stroke[](距离场多层描边)与 glow 族不进场景——main 图片路径未启用/待后续批次;
|
|
1383
|
-
* cmyk 色串与 opacity 字段不进(main 口径:纯色不乘 opacity,引擎不支持 cmyk)。
|
|
1384
|
-
*/
|
|
1385
|
-
export const makePsdEffectsScene = () => {
|
|
1386
|
-
const base = {
|
|
1387
|
-
type: 'image',
|
|
1388
|
-
scaleX: 1,
|
|
1389
|
-
scaleY: 1,
|
|
1390
|
-
angle: 0,
|
|
1391
|
-
originX: 'left',
|
|
1392
|
-
originY: 'top',
|
|
1393
|
-
opacity: 1,
|
|
1394
|
-
strokeWidth: 0,
|
|
1395
|
-
visible: true,
|
|
1396
|
-
src: assetUrl('../../assets/images/nasty_fabric.png')
|
|
1397
|
-
};
|
|
1398
|
-
const dropShadow = (fill, blur, offsetX, offsetY, extra = {}) => ({
|
|
1399
|
-
enabled: true,
|
|
1400
|
-
showInDialog: true,
|
|
1401
|
-
fill,
|
|
1402
|
-
blur,
|
|
1403
|
-
offsetX,
|
|
1404
|
-
offsetY,
|
|
1405
|
-
...extra
|
|
1406
|
-
});
|
|
1407
|
-
const solidFill = (fill, extra = {}) => ({ enabled: true, showInDialog: true, fillType: 0, fill, ...extra });
|
|
1408
|
-
// fillType 1(gradientOverlay 并入形态):fill 为 fabric Gradient 序列化选项,
|
|
1409
|
-
// 与 element.ts gradient2fill 产物同构(percentage 坐标、stops 的 rgba 串已烘 opacity)
|
|
1410
|
-
const gradientFill = (type, coords, stops, extra = {}) => ({
|
|
1411
|
-
enabled: true,
|
|
1412
|
-
showInDialog: true,
|
|
1413
|
-
fillType: 1,
|
|
1414
|
-
fill: { type, colorStops: stops.map(([offset, color]) => ({ offset, color })), coords, gradientUnits: 'percentage' },
|
|
1415
|
-
...extra
|
|
1416
|
-
});
|
|
1417
|
-
const floralSrc = assetUrl('../../assets/images/greyfloral.png');
|
|
1418
|
-
return [
|
|
1419
|
-
{ ...base, id: 'pe0', left: 60, top: 40, effects: { dropShadow: [dropShadow('rgba(40,40,60,0.45)', 12, 10, 10)] } },
|
|
1420
|
-
{
|
|
1421
|
-
...base,
|
|
1422
|
-
id: 'pe1',
|
|
1423
|
-
left: 320,
|
|
1424
|
-
top: 40,
|
|
1425
|
-
effects: {
|
|
1426
|
-
dropShadow: [dropShadow('rgba(160,60,60,0.4)', 14, 14, 8), dropShadow('rgba(40,60,160,0.35)', 8, -10, 14)]
|
|
1427
|
-
}
|
|
1428
|
-
},
|
|
1429
|
-
{ ...base, id: 'pe2', left: 580, top: 40, effects: { dropShadow: [dropShadow('rgba(30,60,30,0.5)', 0, 16, 8)] } },
|
|
1430
|
-
{
|
|
1431
|
-
...base,
|
|
1432
|
-
id: 'pe3',
|
|
1433
|
-
left: 840,
|
|
1434
|
-
top: 40,
|
|
1435
|
-
angle: 25,
|
|
1436
|
-
scaleX: 1.3,
|
|
1437
|
-
scaleY: 0.85,
|
|
1438
|
-
effects: { dropShadow: [dropShadow('rgba(60,50,40,0.45)', 10, 12, 12)] }
|
|
1439
|
-
},
|
|
1440
|
-
{
|
|
1441
|
-
...base,
|
|
1442
|
-
id: 'pe4',
|
|
1443
|
-
left: 60,
|
|
1444
|
-
top: 280,
|
|
1445
|
-
src: floralSrc,
|
|
1446
|
-
effects: { solidFill: [solidFill('rgba(200,80,80,0.55)')] }
|
|
1447
|
-
},
|
|
1448
|
-
{
|
|
1449
|
-
...base,
|
|
1450
|
-
id: 'pe5',
|
|
1451
|
-
left: 320,
|
|
1452
|
-
top: 280,
|
|
1453
|
-
src: floralSrc,
|
|
1454
|
-
effects: {
|
|
1455
|
-
dropShadow: [dropShadow('rgba(40,40,60,0.45)', 10, 8, 10)],
|
|
1456
|
-
solidFill: [solidFill('rgba(80,160,200,0.4)')]
|
|
1457
|
-
}
|
|
1458
|
-
},
|
|
1459
|
-
{
|
|
1460
|
-
...base,
|
|
1461
|
-
id: 'pe6',
|
|
1462
|
-
left: 580,
|
|
1463
|
-
top: 280,
|
|
1464
|
-
opacity: 0.85,
|
|
1465
|
-
effects: {
|
|
1466
|
-
dropShadow: [dropShadow('rgba(120,60,160,0.45)', 12, 10, 10)],
|
|
1467
|
-
solidFill: [solidFill('rgba(240,200,80,0.5)'), solidFill('rgba(80,200,140,0.3)')]
|
|
1468
|
-
}
|
|
1469
|
-
},
|
|
1470
|
-
{
|
|
1471
|
-
...base,
|
|
1472
|
-
id: 'pe7',
|
|
1473
|
-
left: 840,
|
|
1474
|
-
top: 280,
|
|
1475
|
-
effects: { disabled: true, dropShadow: [dropShadow('rgba(255,0,0,0.9)', 20, 20, 20)] }
|
|
1476
|
-
},
|
|
1477
|
-
// P3-5b fillType 1:线性渐变(纵向、两端带 alpha 渐隐——PSD opacityStops
|
|
1478
|
-
// 已烘进 rgba 的形态)
|
|
1479
|
-
{
|
|
1480
|
-
...base,
|
|
1481
|
-
id: 'pe8',
|
|
1482
|
-
left: 60,
|
|
1483
|
-
top: 520,
|
|
1484
|
-
src: floralSrc,
|
|
1485
|
-
effects: {
|
|
1486
|
-
solidFill: [
|
|
1487
|
-
gradientFill('linear', { x1: 0.5, y1: 0, x2: 0.5, y2: 1 }, [
|
|
1488
|
-
[0, 'rgba(60,20,90,0.85)'],
|
|
1489
|
-
[0.5, 'rgba(200,60,120,0.55)'],
|
|
1490
|
-
[1, 'rgba(240,220,80,0.1)']
|
|
1491
|
-
])
|
|
1492
|
-
]
|
|
1493
|
-
}
|
|
1494
|
-
},
|
|
1495
|
-
// 径向渐变(中心发光形态;r2=0.6 覆盖大半画布)
|
|
1496
|
-
{
|
|
1497
|
-
...base,
|
|
1498
|
-
id: 'pe9',
|
|
1499
|
-
left: 320,
|
|
1500
|
-
top: 520,
|
|
1501
|
-
src: floralSrc,
|
|
1502
|
-
effects: {
|
|
1503
|
-
solidFill: [
|
|
1504
|
-
gradientFill('radial', { x1: 0.5, y1: 0.5, r1: 0, x2: 0.5, y2: 0.5, r2: 0.6 }, [
|
|
1505
|
-
[0, 'rgba(255,240,180,0.95)'],
|
|
1506
|
-
[0.55, 'rgba(230,120,50,0.5)'],
|
|
1507
|
-
[1, 'rgba(60,20,90,0.8)']
|
|
1508
|
-
])
|
|
1509
|
-
]
|
|
1510
|
-
}
|
|
1511
|
-
},
|
|
1512
|
-
// 多层序:纯色在下、渐变在上(parser 产出序:solidFill(0) 先、gradientOverlay
|
|
1513
|
-
// 反转并入;drawFills 数组序绘制)+ 斜角 linear 验证非轴对齐 + 对象旋转
|
|
1514
|
-
{
|
|
1515
|
-
...base,
|
|
1516
|
-
id: 'pe10',
|
|
1517
|
-
left: 580,
|
|
1518
|
-
top: 520,
|
|
1519
|
-
angle: 18,
|
|
1520
|
-
src: floralSrc,
|
|
1521
|
-
effects: {
|
|
1522
|
-
dropShadow: [dropShadow('rgba(40,40,60,0.4)', 10, 8, 10)],
|
|
1523
|
-
solidFill: [
|
|
1524
|
-
solidFill('rgba(20,40,80,0.35)'),
|
|
1525
|
-
gradientFill('linear', { x1: 0.1, y1: 0.1, x2: 0.9, y2: 0.7 }, [
|
|
1526
|
-
[0, 'rgba(120,220,140,0.7)'],
|
|
1527
|
-
[1, 'rgba(180,40,60,0.25)']
|
|
1528
|
-
])
|
|
1529
|
-
]
|
|
1530
|
-
}
|
|
1531
|
-
},
|
|
1532
|
-
// P3-5b(2/2) stroke[]:距离场多层描边(右侧余量列 x=1060,720p 视口内)
|
|
1533
|
-
// pe11 双层同心(主描边窄在上、外圈宽在下——drawStrokes 倒序:索引大先画底层)
|
|
1534
|
-
{
|
|
1535
|
-
...base,
|
|
1536
|
-
id: 'pe11',
|
|
1537
|
-
left: 1060,
|
|
1538
|
-
top: 40,
|
|
1539
|
-
src: floralSrc,
|
|
1540
|
-
effects: {
|
|
1541
|
-
stroke: [
|
|
1542
|
-
{ enabled: true, showInDialog: true, fill: 'rgba(60,60,200,1)', strokeWidth: 6, strokeAlignment: 'outside' },
|
|
1543
|
-
{ enabled: true, showInDialog: true, fill: 'rgba(255,255,255,0.95)', strokeWidth: 16, strokeAlignment: 'outside' }
|
|
1544
|
-
]
|
|
1545
|
-
}
|
|
1546
|
-
},
|
|
1547
|
-
// pe12 center 对齐:描边跨 alpha 轮廓(内半叠图上、外半在 padding)
|
|
1548
|
-
{
|
|
1549
|
-
...base,
|
|
1550
|
-
id: 'pe12',
|
|
1551
|
-
left: 1060,
|
|
1552
|
-
top: 260,
|
|
1553
|
-
src: floralSrc,
|
|
1554
|
-
effects: {
|
|
1555
|
-
stroke: [{ enabled: true, showInDialog: true, fill: 'rgba(230,120,40,0.9)', strokeWidth: 14, strokeAlignment: 'center' }]
|
|
1556
|
-
}
|
|
1557
|
-
},
|
|
1558
|
-
// pe13 inside 对齐 + 缩放链:不透明图(nasty 织物)padT=0、整块前景——
|
|
1559
|
-
// inverted 无种子即退化,main 的边界种子补丁是唯一非平凡路径
|
|
1560
|
-
{
|
|
1561
|
-
...base,
|
|
1562
|
-
id: 'pe13',
|
|
1563
|
-
left: 1060,
|
|
1564
|
-
top: 470,
|
|
1565
|
-
scaleX: 0.85,
|
|
1566
|
-
scaleY: 0.85,
|
|
1567
|
-
effects: {
|
|
1568
|
-
stroke: [{ enabled: true, showInDialog: true, fill: 'rgba(40,160,90,0.95)', strokeWidth: 12, strokeAlignment: 'inside' }]
|
|
1569
|
-
}
|
|
1570
|
-
}
|
|
1571
|
-
];
|
|
1572
|
-
};
|
|
1573
|
-
/**
|
|
1574
|
-
* 形状场景(Phase 3 P3-1):ellipse/circle/polygon(凸/凹)/polyline。
|
|
1575
|
-
*
|
|
1576
|
-
* 全部纯色不透明、strokeWidth 0:描边属 P3-2、半透明堆叠的舍入差与本批目标
|
|
1577
|
-
* (三角化几何正确性)无关。s4 是凹 L 形——包围盒判定会把右下缺口当实心,
|
|
1578
|
-
* 耳切必须只填 L 形本体,这是本场景的核心用例。s5 带 scale、s2 带角度,
|
|
1579
|
-
* 覆盖 dims→aCoords 的变换链。s6/s7 是 polyline:fabric 的 Polyline 默认
|
|
1580
|
-
* fill 为空(不渲染),有 fill 时按 canvas fill() 自动闭合——两种语义都要对上。
|
|
1581
|
-
*/
|
|
1582
|
-
export const makeShapeScene = () => {
|
|
1583
|
-
const base = {
|
|
1584
|
-
// 占位(每个条目各自覆写):SerializedNode.type 必填,与 makeTextScene 的 'textbox' 同套路
|
|
1585
|
-
type: 'polygon',
|
|
1586
|
-
scaleX: 1,
|
|
1587
|
-
scaleY: 1,
|
|
1588
|
-
angle: 0,
|
|
1589
|
-
originX: 'left',
|
|
1590
|
-
originY: 'top',
|
|
1591
|
-
opacity: 1,
|
|
1592
|
-
strokeWidth: 0,
|
|
1593
|
-
visible: true
|
|
1594
|
-
};
|
|
1595
|
-
return [
|
|
1596
|
-
{ ...base, id: 's0', type: 'ellipse', left: 80, top: 60, rx: 90, ry: 60, fill: '#c04040' },
|
|
1597
|
-
{ ...base, id: 's1', type: 'circle', left: 320, top: 60, radius: 70, fill: '#2f6fbf' },
|
|
1598
|
-
{ ...base, id: 's2', type: 'ellipse', left: 540, top: 60, rx: 80, ry: 50, angle: 30, fill: '#3f8f5f' },
|
|
1599
|
-
{
|
|
1600
|
-
...base,
|
|
1601
|
-
id: 's3',
|
|
1602
|
-
type: 'polygon',
|
|
1603
|
-
left: 80,
|
|
1604
|
-
top: 260,
|
|
1605
|
-
points: [
|
|
1606
|
-
{ x: 0, y: 0 },
|
|
1607
|
-
{ x: 120, y: 0 },
|
|
1608
|
-
{ x: 60, y: 110 }
|
|
1609
|
-
],
|
|
1610
|
-
fill: '#b07030'
|
|
1611
|
-
},
|
|
1612
|
-
{
|
|
1613
|
-
...base,
|
|
1614
|
-
id: 's4',
|
|
1615
|
-
type: 'polygon',
|
|
1616
|
-
left: 260,
|
|
1617
|
-
top: 260,
|
|
1618
|
-
points: [
|
|
1619
|
-
{ x: 0, y: 0 },
|
|
1620
|
-
{ x: 120, y: 0 },
|
|
1621
|
-
{ x: 120, y: 40 },
|
|
1622
|
-
{ x: 40, y: 40 },
|
|
1623
|
-
{ x: 40, y: 120 },
|
|
1624
|
-
{ x: 0, y: 120 }
|
|
1625
|
-
],
|
|
1626
|
-
fill: '#7a4fa0'
|
|
1627
|
-
},
|
|
1628
|
-
{
|
|
1629
|
-
...base,
|
|
1630
|
-
id: 's5',
|
|
1631
|
-
type: 'polygon',
|
|
1632
|
-
left: 470,
|
|
1633
|
-
top: 300,
|
|
1634
|
-
scaleX: 1.4,
|
|
1635
|
-
scaleY: 0.8,
|
|
1636
|
-
points: [
|
|
1637
|
-
{ x: 60, y: 0 },
|
|
1638
|
-
{ x: 120, y: 45 },
|
|
1639
|
-
{ x: 95, y: 115 },
|
|
1640
|
-
{ x: 25, y: 115 },
|
|
1641
|
-
{ x: 0, y: 45 }
|
|
1642
|
-
],
|
|
1643
|
-
fill: '#108080'
|
|
1644
|
-
},
|
|
1645
|
-
{
|
|
1646
|
-
...base,
|
|
1647
|
-
id: 's6',
|
|
1648
|
-
type: 'polyline',
|
|
1649
|
-
left: 720,
|
|
1650
|
-
top: 260,
|
|
1651
|
-
points: [
|
|
1652
|
-
{ x: 0, y: 0 },
|
|
1653
|
-
{ x: 120, y: 50 },
|
|
1654
|
-
{ x: 30, y: 70 },
|
|
1655
|
-
{ x: 140, y: 140 }
|
|
1656
|
-
],
|
|
1657
|
-
fill: '#a03070'
|
|
1658
|
-
},
|
|
1659
|
-
{
|
|
1660
|
-
...base,
|
|
1661
|
-
id: 's7',
|
|
1662
|
-
type: 'polyline',
|
|
1663
|
-
left: 720,
|
|
1664
|
-
top: 470,
|
|
1665
|
-
// fabric Polyline 默认 fill 为空:两侧都应不渲染(引擎 parseColor('') → 全透明)
|
|
1666
|
-
points: [
|
|
1667
|
-
{ x: 0, y: 0 },
|
|
1668
|
-
{ x: 110, y: 60 },
|
|
1669
|
-
{ x: 20, y: 120 }
|
|
1670
|
-
],
|
|
1671
|
-
fill: ''
|
|
1672
|
-
}
|
|
1673
|
-
];
|
|
1674
|
-
};
|
|
1675
|
-
/**
|
|
1676
|
-
* 路径场景(Phase 3 P3-6a):fabric Path/FabricPath 的填充渲染 parity。
|
|
1677
|
-
*
|
|
1678
|
-
* 覆盖:简单折线闭合 / 贝塞尔曲线极值(dims 与填充同时吃扁平化误差)/ 椭圆弧
|
|
1679
|
-
* (A→C 转换)/ evenodd 与 nonzero 两种 fillRule 的洞 / 多子路径岛 / 渐变填充 /
|
|
1680
|
-
* 旋转缩放变换链。全部 strokeWidth 0——路径描边属 P3-2。
|
|
1681
|
-
*/
|
|
1682
|
-
export const makePathScene = () => {
|
|
1683
|
-
const base = {
|
|
1684
|
-
type: 'Path',
|
|
1685
|
-
scaleX: 1,
|
|
1686
|
-
scaleY: 1,
|
|
1687
|
-
angle: 0,
|
|
1688
|
-
originX: 'left',
|
|
1689
|
-
originY: 'top',
|
|
1690
|
-
opacity: 1,
|
|
1691
|
-
strokeWidth: 0,
|
|
1692
|
-
visible: true
|
|
1693
|
-
};
|
|
1694
|
-
return [
|
|
1695
|
-
// 折线闭合三角(基线:无曲线误差)
|
|
1696
|
-
{ ...base, id: 'pa0', left: 60, top: 40, fill: 'rgba(200,80,80,0.9)', path: [['M', 10, 10], ['L', 180, 30], ['L', 60, 140], ['Z']] },
|
|
1697
|
-
// 曲线主体(C 的极值超出端点——dims 与三角化同时考验)
|
|
1698
|
-
{ ...base, id: 'pa1', left: 320, top: 40, fill: 'rgba(80,140,220,0.9)', path: 'M 10 100 C 40 -60 160 -60 190 100 C 220 40 120 160 100 120 Z' },
|
|
1699
|
-
// 椭圆弧(A 命令 → C 段)+ 弧极值
|
|
1700
|
-
{ ...base, id: 'pa2', left: 580, top: 40, fill: 'rgba(90,190,130,0.9)', path: 'M 10 90 A 90 60 20 1 0 190 90 A 90 60 20 1 0 10 90 Z' },
|
|
1701
|
-
// evenodd 洞(同向绕环 + fillRule evenodd——偶奇按嵌套深度相减)
|
|
1702
|
-
{
|
|
1703
|
-
...base,
|
|
1704
|
-
id: 'pa3',
|
|
1705
|
-
left: 840,
|
|
1706
|
-
top: 40,
|
|
1707
|
-
fill: 'rgba(160,100,200,0.9)',
|
|
1708
|
-
fillRule: 'evenodd',
|
|
1709
|
-
path: 'M 0 0 L 180 0 L 180 120 L 0 120 Z M 40 30 L 140 30 L 140 90 L 40 90 Z'
|
|
1710
|
-
},
|
|
1711
|
-
// nonzero 洞(反向绕环,缺省 fillRule——fabric 默认按环绕数相减)
|
|
1712
|
-
{
|
|
1713
|
-
...base,
|
|
1714
|
-
id: 'pa4',
|
|
1715
|
-
left: 60,
|
|
1716
|
-
top: 260,
|
|
1717
|
-
fill: 'rgba(230,160,60,0.9)',
|
|
1718
|
-
path: 'M 0 0 L 180 0 L 180 120 L 0 120 Z M 40 30 L 40 90 L 140 90 L 140 30 Z'
|
|
1719
|
-
},
|
|
1720
|
-
// 多子路径 + 岛中洞(evenodd 三层)+ Q/T 简写
|
|
1721
|
-
{
|
|
1722
|
-
...base,
|
|
1723
|
-
id: 'pa5',
|
|
1724
|
-
left: 320,
|
|
1725
|
-
top: 260,
|
|
1726
|
-
fill: 'rgba(70,170,180,0.9)',
|
|
1727
|
-
fillRule: 'evenodd',
|
|
1728
|
-
path: 'M 0 0 L 200 0 L 200 150 L 0 150 Z M 30 25 L 170 25 L 170 125 L 30 125 Z M 80 55 Q 100 35 120 55 Q 140 75 120 95 Q 100 115 80 95 Q 60 75 80 55 Z'
|
|
1729
|
-
},
|
|
1730
|
-
// 渐变填充路径(P3-3 渐变管线复用)
|
|
1731
|
-
{
|
|
1732
|
-
...base,
|
|
1733
|
-
id: 'pa6',
|
|
1734
|
-
left: 580,
|
|
1735
|
-
top: 260,
|
|
1736
|
-
fill: {
|
|
1737
|
-
type: 'linear',
|
|
1738
|
-
coords: { x1: 0, y1: 0, x2: 1, y2: 1 },
|
|
1739
|
-
colorStops: [
|
|
1740
|
-
{ offset: 0, color: 'rgba(120,40,180,0.95)' },
|
|
1741
|
-
{ offset: 1, color: 'rgba(240,180,60,0.85)' }
|
|
1742
|
-
],
|
|
1743
|
-
gradientUnits: 'percentage'
|
|
1744
|
-
},
|
|
1745
|
-
path: 'M 20 130 C 60 20 160 20 190 110 C 150 60 90 70 20 130 Z'
|
|
1746
|
-
},
|
|
1747
|
-
// 旋转 + 缩放 + S 简写曲线(变换链下的三角化铺放)
|
|
1748
|
-
{
|
|
1749
|
-
...base,
|
|
1750
|
-
id: 'pa7',
|
|
1751
|
-
left: 840,
|
|
1752
|
-
top: 280,
|
|
1753
|
-
angle: 20,
|
|
1754
|
-
scaleX: 1.15,
|
|
1755
|
-
scaleY: 0.85,
|
|
1756
|
-
fill: 'rgba(40,60,60,0.9)',
|
|
1757
|
-
path: 'M 10 10 C 60 10 90 40 100 90 S 60 150 20 130 S -20 40 10 10 Z'
|
|
1758
|
-
}
|
|
1759
|
-
];
|
|
1760
|
-
};
|
|
1761
|
-
/**
|
|
1762
|
-
* 路径族锚点编辑场景(P4-7):Path 折线闭合(拖点/插点/类型切换基准)+ Path
|
|
1763
|
-
* 曲线(C 手柄/连接线)+ polygon(顶点拖拽)+ line(端点拖拽)。位形对齐
|
|
1764
|
-
* pathSession.spec 的手推基准:p0 四锚点场景位 (100,100)/(200,100)/(200,180)/
|
|
1765
|
-
* (100,180)、上边中点 (150,100)。
|
|
1766
|
-
*/
|
|
1767
|
-
export const makePathEditScene = () => {
|
|
1768
|
-
const base = {
|
|
1769
|
-
type: 'Path',
|
|
1770
|
-
scaleX: 1,
|
|
1771
|
-
scaleY: 1,
|
|
1772
|
-
angle: 0,
|
|
1773
|
-
originX: 'left',
|
|
1774
|
-
originY: 'top',
|
|
1775
|
-
opacity: 1,
|
|
1776
|
-
strokeWidth: 0,
|
|
1777
|
-
visible: true
|
|
1778
|
-
};
|
|
1779
|
-
return [
|
|
1780
|
-
// 折线闭合(基准:锚点/插点/类型切换)
|
|
1781
|
-
{ ...base, type: 'Path', id: 'p0', left: 100, top: 100, fill: 'rgba(74,124,199,0.9)', path: [['M', 10, 10], ['L', 110, 10], ['L', 110, 90], ['L', 10, 90], ['Z']] },
|
|
1782
|
-
// 曲线主体(C 双手柄 + 连接线)
|
|
1783
|
-
{ ...base, type: 'Path', id: 'p1', left: 320, top: 100, fill: 'rgba(199,74,143,0.9)', path: 'M 10 60 C 40 -40 160 -40 190 60 C 160 140 40 140 10 60 Z' },
|
|
1784
|
-
// polygon 顶点拖拽
|
|
1785
|
-
{
|
|
1786
|
-
...base,
|
|
1787
|
-
type: 'polygon',
|
|
1788
|
-
id: 'pg0',
|
|
1789
|
-
left: 100,
|
|
1790
|
-
top: 300,
|
|
1791
|
-
fill: 'rgba(90,170,110,0.9)',
|
|
1792
|
-
points: [
|
|
1793
|
-
{ x: 0, y: 0 },
|
|
1794
|
-
{ x: 100, y: 0 },
|
|
1795
|
-
{ x: 0, y: 80 }
|
|
1796
|
-
]
|
|
1797
|
-
},
|
|
1798
|
-
// line 端点拖拽(唯一带描边者)
|
|
1799
|
-
{ ...base, type: 'Line', id: 'ln0', left: 320, top: 300, stroke: '#333333', strokeWidth: 4, x1: -60, y1: -40, x2: 60, y2: 40 }
|
|
1800
|
-
];
|
|
1801
|
-
};
|
|
1802
|
-
/**
|
|
1803
|
-
* 描边场景(Phase 3 P3-2):形状/路径族的 fabric 描边 parity。
|
|
1804
|
-
*
|
|
1805
|
-
* 覆盖:四形状族 ×(实线/虚线+相位偏移/round·bevel 连接/round·square 线帽/
|
|
1806
|
-
* 斜接尖峰 miterLimit)、strokeUniform × 非均匀缩放(描边宽恒定、几何反向补偿)、
|
|
1807
|
-
* 描边盖填充与 paintFirst stroke 互换、半透明描边、变换链下虚线相位。
|
|
1808
|
-
*/
|
|
1809
|
-
export const makeStrokeShapeScene = () => {
|
|
1810
|
-
const base = {
|
|
1811
|
-
type: 'polygon',
|
|
1812
|
-
scaleX: 1,
|
|
1813
|
-
scaleY: 1,
|
|
1814
|
-
angle: 0,
|
|
1815
|
-
originX: 'left',
|
|
1816
|
-
originY: 'top',
|
|
1817
|
-
opacity: 1,
|
|
1818
|
-
strokeWidth: 0,
|
|
1819
|
-
visible: true
|
|
1820
|
-
};
|
|
1821
|
-
const star = (cx, cy, r, r2, n) => {
|
|
1822
|
-
const pts = [];
|
|
1823
|
-
for (let i = 0; i < n * 2; i++) {
|
|
1824
|
-
const rr = i % 2 === 0 ? r : r2;
|
|
1825
|
-
const a = (Math.PI / n) * i - Math.PI / 2;
|
|
1826
|
-
pts.push({ x: cx + rr * Math.cos(a), y: cy + rr * Math.sin(a) });
|
|
1827
|
-
}
|
|
1828
|
-
return pts;
|
|
1829
|
-
};
|
|
1830
|
-
return [
|
|
1831
|
-
// polygon 尖峰斜接(星形 miter 尖端)+ 填充上盖描边(paintFirst 缺省 fill)
|
|
1832
|
-
{ ...base, id: 'st0', left: 60, top: 40, fill: 'rgba(250,235,200,0.9)', stroke: 'rgba(60,60,120,0.95)', strokeWidth: 5, points: star(90, 75, 70, 30, 5) },
|
|
1833
|
-
// 虚线 + 相位偏移 + round 线帽(相位在整路径内连续——canvas 同源)
|
|
1834
|
-
{
|
|
1835
|
-
...base,
|
|
1836
|
-
id: 'st1',
|
|
1837
|
-
left: 300,
|
|
1838
|
-
top: 40,
|
|
1839
|
-
fill: '',
|
|
1840
|
-
stroke: 'rgba(180,50,50,0.95)',
|
|
1841
|
-
strokeWidth: 4,
|
|
1842
|
-
strokeDashArray: [12, 8],
|
|
1843
|
-
strokeDashOffset: 6,
|
|
1844
|
-
strokeLineCap: 'round',
|
|
1845
|
-
points: star(90, 75, 70, 32, 6)
|
|
1846
|
-
},
|
|
1847
|
-
// bevel 连接 + square 线帽(虚线方头)
|
|
1848
|
-
{
|
|
1849
|
-
...base,
|
|
1850
|
-
id: 'st2',
|
|
1851
|
-
left: 540,
|
|
1852
|
-
top: 40,
|
|
1853
|
-
fill: '',
|
|
1854
|
-
stroke: 'rgba(40,130,80,0.95)',
|
|
1855
|
-
strokeWidth: 6,
|
|
1856
|
-
strokeDashArray: [16, 10],
|
|
1857
|
-
strokeLineJoin: 'bevel',
|
|
1858
|
-
strokeLineCap: 'square',
|
|
1859
|
-
points: star(90, 75, 68, 28, 7)
|
|
1860
|
-
},
|
|
1861
|
-
// ellipse 描边(虚线 + round 连接)
|
|
1862
|
-
{
|
|
1863
|
-
...base,
|
|
1864
|
-
id: 'st3',
|
|
1865
|
-
type: 'ellipse',
|
|
1866
|
-
left: 800,
|
|
1867
|
-
top: 40,
|
|
1868
|
-
rx: 95,
|
|
1869
|
-
ry: 62,
|
|
1870
|
-
fill: 'rgba(210,230,250,0.8)',
|
|
1871
|
-
stroke: 'rgba(150,40,140,0.95)',
|
|
1872
|
-
strokeWidth: 5,
|
|
1873
|
-
strokeDashArray: [10, 6],
|
|
1874
|
-
strokeLineJoin: 'round'
|
|
1875
|
-
},
|
|
1876
|
-
// strokeUniform × 非均匀缩放:描边宽恒定 6(几何 y 反向补偿——fabric 已知怪癖照抄)
|
|
1877
|
-
{ ...base, id: 'st4', left: 60, top: 240, scaleX: 1.6, scaleY: 0.7, fill: '', stroke: 'rgba(30,30,30,0.95)', strokeWidth: 6, strokeUniform: true, points: star(90, 70, 72, 30, 5) },
|
|
1878
|
-
// 非 uniform:描边宽随各向异性缩放(canvas lineWidth 受 CTM 变换)
|
|
1879
|
-
{ ...base, id: 'st5', left: 340, top: 240, scaleX: 1.6, scaleY: 0.7, angle: 15, fill: 'rgba(255,255,255,0.5)', stroke: 'rgba(200,120,20,0.95)', strokeWidth: 4, points: star(90, 70, 72, 30, 5) },
|
|
1880
|
-
// paintFirst stroke:描边垫在填充之下(外半可见、内半被填充盖住)
|
|
1881
|
-
{ ...base, id: 'st6', left: 620, top: 240, fill: 'rgba(240,240,240,1)', stroke: 'rgba(200,30,30,1)', strokeWidth: 10, paintFirst: 'stroke', points: star(90, 70, 72, 34, 5) },
|
|
1882
|
-
// Path 描边(曲线 + S 简写 + round 连接)与圆
|
|
1883
|
-
{
|
|
1884
|
-
...base,
|
|
1885
|
-
id: 'st7',
|
|
1886
|
-
type: 'Path',
|
|
1887
|
-
left: 60,
|
|
1888
|
-
top: 440,
|
|
1889
|
-
fill: '',
|
|
1890
|
-
stroke: 'rgba(30,90,170,0.95)',
|
|
1891
|
-
strokeWidth: 4,
|
|
1892
|
-
strokeLineJoin: 'round',
|
|
1893
|
-
path: 'M 10 90 C 40 -40 140 -40 170 90 S 90 150 10 90 Z'
|
|
1894
|
-
},
|
|
1895
|
-
// rect 描边(fabricrect 族的实色矩形路径)+ 旋转
|
|
1896
|
-
{ ...base, id: 'st8', type: 'rect', left: 320, top: 450, width: 220, height: 130, angle: 12, fill: 'rgba(235,225,245,0.9)', stroke: 'rgba(90,40,120,0.95)', strokeWidth: 6 },
|
|
1897
|
-
// circle 描边(虚线圆)
|
|
1898
|
-
{ ...base, id: 'st9', type: 'circle', left: 620, top: 440, radius: 70, fill: '', stroke: 'rgba(20,20,20,0.9)', strokeWidth: 3, strokeDashArray: [8, 8] }
|
|
1899
|
-
];
|
|
1900
|
-
};
|
|
1901
|
-
/**
|
|
1902
|
-
* 路径定制效果场景(Phase 3 P3-5c):FabricPath 的应用定制——dropShadow[] 多层
|
|
1903
|
-
* 投影(PathCommon.renderShadow:raw 偏移 + 填充剪影,无擦除)与
|
|
1904
|
-
* strokeAlignment OUTER/INNER(destination-out / clip 技巧)。
|
|
1905
|
-
* 参考面走应用 FabricPath(应用定制语义对拍应用类;其构造器强制
|
|
1906
|
-
* strokeUniform=true,引擎侧同口径)。
|
|
1907
|
-
*/
|
|
1908
|
-
export const makePathEffectsScene = () => {
|
|
1909
|
-
const base = {
|
|
1910
|
-
type: 'Path',
|
|
1911
|
-
scaleX: 1,
|
|
1912
|
-
scaleY: 1,
|
|
1913
|
-
angle: 0,
|
|
1914
|
-
originX: 'left',
|
|
1915
|
-
originY: 'top',
|
|
1916
|
-
opacity: 1,
|
|
1917
|
-
strokeWidth: 0,
|
|
1918
|
-
visible: true
|
|
1919
|
-
};
|
|
1920
|
-
const dropShadow = (fill, blur, offsetX, offsetY) => ({ enabled: true, showInDialog: true, fill, blur, offsetX, offsetY });
|
|
1921
|
-
return [
|
|
1922
|
-
// 单层投影(raw 偏移——与图片族的 scale 补偿公式不同的口径)
|
|
1923
|
-
{
|
|
1924
|
-
...base,
|
|
1925
|
-
id: 'px0',
|
|
1926
|
-
left: 60,
|
|
1927
|
-
top: 60,
|
|
1928
|
-
fill: 'rgba(250,240,220,0.95)',
|
|
1929
|
-
path: 'M 10 10 C 80 -30 160 20 180 90 C 120 150 30 130 10 10 Z',
|
|
1930
|
-
effects: { dropShadow: [dropShadow('rgba(40,40,80,0.5)', 14, 12, 14)] }
|
|
1931
|
-
},
|
|
1932
|
-
// 多层投影累积(数组序:后层压前层)
|
|
1933
|
-
{
|
|
1934
|
-
...base,
|
|
1935
|
-
id: 'px1',
|
|
1936
|
-
left: 340,
|
|
1937
|
-
top: 60,
|
|
1938
|
-
fill: 'rgba(220,240,250,0.95)',
|
|
1939
|
-
path: 'M 20 120 C 60 20 160 20 190 100 C 150 150 60 150 20 120 Z',
|
|
1940
|
-
effects: { dropShadow: [dropShadow('rgba(160,60,60,0.45)', 16, 16, 10), dropShadow('rgba(60,60,160,0.4)', 8, -12, 16)] }
|
|
1941
|
-
},
|
|
1942
|
-
// 半透明填充:投影强度随填充 alpha(剪影同源语义)
|
|
1943
|
-
{
|
|
1944
|
-
...base,
|
|
1945
|
-
id: 'px2',
|
|
1946
|
-
left: 620,
|
|
1947
|
-
top: 60,
|
|
1948
|
-
fill: 'rgba(200,220,160,0.55)',
|
|
1949
|
-
path: 'M 10 110 C 50 10 150 10 180 110 C 130 150 60 150 10 110 Z',
|
|
1950
|
-
effects: { dropShadow: [dropShadow('rgba(30,60,30,0.6)', 12, 10, 12)] }
|
|
1951
|
-
},
|
|
1952
|
-
// 空填充 + 投影:main 的 _renderFill 不画 → 无投影(锁口径)
|
|
1953
|
-
{
|
|
1954
|
-
...base,
|
|
1955
|
-
id: 'px3',
|
|
1956
|
-
left: 900,
|
|
1957
|
-
top: 60,
|
|
1958
|
-
fill: '',
|
|
1959
|
-
path: 'M 10 10 L 150 10 L 150 120 L 10 120 Z',
|
|
1960
|
-
effects: { dropShadow: [dropShadow('rgba(255,0,0,0.9)', 20, 20, 20)] }
|
|
1961
|
-
},
|
|
1962
|
-
// OUTER 描边(双倍宽 + destination-out 擦内侧)
|
|
1963
|
-
{
|
|
1964
|
-
...base,
|
|
1965
|
-
id: 'px4',
|
|
1966
|
-
left: 60,
|
|
1967
|
-
top: 340,
|
|
1968
|
-
fill: 'rgba(240,235,245,1)',
|
|
1969
|
-
stroke: 'rgba(150,60,140,1)',
|
|
1970
|
-
strokeWidth: 8,
|
|
1971
|
-
strokeAlignment: 'outside',
|
|
1972
|
-
path: 'M 10 100 C 40 10 140 10 170 100 C 120 150 50 150 10 100 Z'
|
|
1973
|
-
},
|
|
1974
|
-
// INNER 描边(clip 内侧 + 双倍宽)
|
|
1975
|
-
{
|
|
1976
|
-
...base,
|
|
1977
|
-
id: 'px5',
|
|
1978
|
-
left: 340,
|
|
1979
|
-
top: 340,
|
|
1980
|
-
fill: 'rgba(235,245,235,1)',
|
|
1981
|
-
stroke: 'rgba(40,90,50,1)',
|
|
1982
|
-
strokeWidth: 8,
|
|
1983
|
-
strokeAlignment: 'inside',
|
|
1984
|
-
path: 'M 10 100 C 40 10 140 10 170 100 C 120 150 50 150 10 100 Z'
|
|
1985
|
-
},
|
|
1986
|
-
// OUTER + 虚线(对齐技巧与虚线相位叠加)+ 旋转
|
|
1987
|
-
{
|
|
1988
|
-
...base,
|
|
1989
|
-
id: 'px6',
|
|
1990
|
-
left: 620,
|
|
1991
|
-
top: 350,
|
|
1992
|
-
angle: 15,
|
|
1993
|
-
fill: 'rgba(245,240,225,1)',
|
|
1994
|
-
stroke: 'rgba(60,60,150,1)',
|
|
1995
|
-
strokeWidth: 6,
|
|
1996
|
-
strokeAlignment: 'outside',
|
|
1997
|
-
strokeDashArray: [14, 8],
|
|
1998
|
-
path: 'M 10 90 C 50 -20 150 -10 180 90 C 130 140 50 140 10 90 Z'
|
|
1999
|
-
},
|
|
2000
|
-
// 投影 + OUTER 描边组合(below 相位投影 + 描边层)
|
|
2001
|
-
{
|
|
2002
|
-
...base,
|
|
2003
|
-
id: 'px7',
|
|
2004
|
-
left: 900,
|
|
2005
|
-
top: 340,
|
|
2006
|
-
fill: 'rgba(250,245,230,1)',
|
|
2007
|
-
stroke: 'rgba(140,90,30,1)',
|
|
2008
|
-
strokeWidth: 7,
|
|
2009
|
-
strokeAlignment: 'outside',
|
|
2010
|
-
path: 'M 15 100 C 45 15 145 15 175 100 C 125 150 55 150 15 100 Z',
|
|
2011
|
-
effects: { dropShadow: [dropShadow('rgba(60,40,20,0.5)', 12, 10, 12)] }
|
|
2012
|
-
}
|
|
2013
|
-
];
|
|
2014
|
-
};
|
|
2015
|
-
/**
|
|
2016
|
-
* 线族场景(Phase 3 P3-6b):Line/arrow/Dimension/ReferenceLine 的描边渲染 parity。
|
|
2017
|
-
*
|
|
2018
|
-
* x1..y2 为中心相对坐标(fabric Line 序列化语义——calcLinePoints 恒等映射),
|
|
2019
|
-
* left/top = 定位。覆盖:实线/虚线/圆帽线、端箭头/双端箭头/虚线箭头/缩放旋转、
|
|
2020
|
-
* 标注(端刻+文本框+沿线旋转)、参考线(自定义点形态——渲染同 Line)。
|
|
2021
|
-
*/
|
|
2022
|
-
export const makeLineScene = () => {
|
|
2023
|
-
const base = {
|
|
2024
|
-
type: 'Line',
|
|
2025
|
-
scaleX: 1,
|
|
2026
|
-
scaleY: 1,
|
|
2027
|
-
angle: 0,
|
|
2028
|
-
originX: 'left',
|
|
2029
|
-
originY: 'top',
|
|
2030
|
-
opacity: 1,
|
|
2031
|
-
visible: true
|
|
2032
|
-
};
|
|
2033
|
-
const line = (x1, y1, x2, y2, left, top) => ({ ...base, x1, y1, x2, y2, left, top });
|
|
2034
|
-
return [
|
|
2035
|
-
// 实线(butt 帽)
|
|
2036
|
-
{ ...line(-90, -35, 90, 35, 150, 75), id: 'ln0', stroke: 'rgba(40,40,60,0.95)', strokeWidth: 3 },
|
|
2037
|
-
// 虚线 + round 帽 + 相位
|
|
2038
|
-
{ ...line(-90, -30, 90, 30, 150, 185), id: 'ln1', stroke: 'rgba(160,50,50,0.95)', strokeWidth: 4, strokeDashArray: [14, 10], strokeDashOffset: 7, strokeLineCap: 'round' },
|
|
2039
|
-
// 水平线(零高度退化)
|
|
2040
|
-
{ ...line(-100, 0, 100, 0, 150, 295), id: 'ln2', stroke: 'rgba(30,100,60,0.95)', strokeWidth: 5 },
|
|
2041
|
-
// 端箭头(默认 arrowType end)
|
|
2042
|
-
{ ...line(-90, -40, 90, 40, 480, 75), id: 'ln3', type: 'arrow', stroke: 'rgba(50,50,150,0.95)', strokeWidth: 3 },
|
|
2043
|
-
// 双端箭头 + 虚线
|
|
2044
|
-
{ ...line(-90, -35, 90, 35, 480, 185), id: 'ln4', type: 'arrow', stroke: 'rgba(150,90,20,0.95)', strokeWidth: 4, strokeDashArray: [12, 8], arrowType: 'both' },
|
|
2045
|
-
// 箭头 + 旋转缩放(头尺寸 = 预设 × √sw,随对象矩阵变换)
|
|
2046
|
-
{ ...line(-80, -30, 80, 30, 460, 295), id: 'ln5', type: 'arrow', angle: 20, scaleX: 1.3, scaleY: 0.8, stroke: 'rgba(120,30,120,0.95)', strokeWidth: 3, arrowWidth: 18, arrowHeight: 27 },
|
|
2047
|
-
// 水平端箭头(2026-09-25 箭头烘焙清晰度 e2e 探针:轴对齐竖直扫描线过杆
|
|
2048
|
-
// 两侧边缘,过渡带宽度判据——1× 烘焙在 zoom 4 下双线性上采样两侧各抹 3-4px)
|
|
2049
|
-
{ ...line(-100, 0, 100, 0, 460, 405), id: 'ln9', type: 'arrow', stroke: 'rgba(30,30,30,0.95)', strokeWidth: 3 },
|
|
2050
|
-
// 标注(整线 + 端刻 + 中点文本框沿线旋转)
|
|
2051
|
-
{
|
|
2052
|
-
...line(-90, -25, 90, 25, 820, 75),
|
|
2053
|
-
id: 'ln6',
|
|
2054
|
-
type: 'Dimension',
|
|
2055
|
-
stroke: 'rgba(30,30,30,0.95)',
|
|
2056
|
-
strokeWidth: 2,
|
|
2057
|
-
text: '120 cm',
|
|
2058
|
-
textFontSize: 28,
|
|
2059
|
-
textColor: '#333333',
|
|
2060
|
-
textBackgroundColor: 'rgba(255,255,255,0.9)',
|
|
2061
|
-
textPadding: 4,
|
|
2062
|
-
textFollowLine: true
|
|
2063
|
-
},
|
|
2064
|
-
// 标注不随线旋转
|
|
2065
|
-
{ ...line(-80, -30, 80, 30, 820, 210), id: 'ln7', type: 'Dimension', angle: 0, stroke: 'rgba(90,30,30,0.95)', strokeWidth: 3, text: '80mm', textFontSize: 24, textFollowLine: false },
|
|
2066
|
-
// 参考线(自定义点形态——渲染同 Line,交互定制不进 parity)
|
|
2067
|
-
{ ...line(-100, -20, 100, 20, 820, 340), id: 'ln8', type: 'ReferenceLine', stroke: 'rgba(200,40,80,0.9)', strokeWidth: 2, strokeDashArray: [6, 6] }
|
|
2068
|
-
];
|
|
2069
|
-
};
|
|
2070
|
-
/**
|
|
2071
|
-
* 虚线文本描边场景(Phase 3 P3-2b):fabric 按 run 一次 strokeText(虚线相位
|
|
2072
|
-
* 在 run 内连续),图集逐字形做不到——run 级烘焙路径的 parity。
|
|
2073
|
-
*/
|
|
2074
|
-
export const makeDashStrokeTextScene = () => {
|
|
2075
|
-
const base = {
|
|
2076
|
-
type: 'textbox',
|
|
2077
|
-
scaleX: 1,
|
|
2078
|
-
scaleY: 1,
|
|
2079
|
-
angle: 0,
|
|
2080
|
-
originX: 'left',
|
|
2081
|
-
originY: 'top',
|
|
2082
|
-
opacity: 1,
|
|
2083
|
-
strokeWidth: 0,
|
|
2084
|
-
visible: true,
|
|
2085
|
-
fill: 'rgba(250,248,240,0.95)',
|
|
2086
|
-
lineHeight: 1.16
|
|
2087
|
-
};
|
|
2088
|
-
return [
|
|
2089
|
-
// 单行虚线(相位整行连续——核心用例)
|
|
2090
|
-
{
|
|
2091
|
-
...base,
|
|
2092
|
-
id: 'kd0',
|
|
2093
|
-
left: 40,
|
|
2094
|
-
top: 40,
|
|
2095
|
-
width: 560,
|
|
2096
|
-
text: '虚线描边 Dashed',
|
|
2097
|
-
fontFamily: 'sans-serif',
|
|
2098
|
-
fontSize: 56,
|
|
2099
|
-
fontWeight: 'bold',
|
|
2100
|
-
stroke: '#c03030',
|
|
2101
|
-
strokeWidth: 5,
|
|
2102
|
-
strokeDashArray: [10, 7]
|
|
2103
|
-
},
|
|
2104
|
-
// 多行虚线(每行相位独立重启——fabric 每行单独 strokeText)
|
|
2105
|
-
{
|
|
2106
|
-
...base,
|
|
2107
|
-
id: 'kd1',
|
|
2108
|
-
left: 640,
|
|
2109
|
-
top: 40,
|
|
2110
|
-
width: 560,
|
|
2111
|
-
text: '多行各自\n重启相位\nDashed lines',
|
|
2112
|
-
fontFamily: 'sans-serif',
|
|
2113
|
-
fontSize: 44,
|
|
2114
|
-
stroke: '#2060c0',
|
|
2115
|
-
strokeWidth: 4,
|
|
2116
|
-
strokeDashArray: [8, 6],
|
|
2117
|
-
strokeDashOffset: 4
|
|
2118
|
-
},
|
|
2119
|
-
// charSpacing ≠ 0:fabric 逐字一段(虚线逐字重启——锁口径)
|
|
2120
|
-
{
|
|
2121
|
-
...base,
|
|
2122
|
-
id: 'kd2',
|
|
2123
|
-
left: 40,
|
|
2124
|
-
top: 200,
|
|
2125
|
-
width: 560,
|
|
2126
|
-
text: '字距虚线 Spaced',
|
|
2127
|
-
fontFamily: 'sans-serif',
|
|
2128
|
-
fontSize: 48,
|
|
2129
|
-
stroke: '#207050',
|
|
2130
|
-
strokeWidth: 4,
|
|
2131
|
-
strokeDashArray: [9, 6],
|
|
2132
|
-
charSpacing: 300
|
|
2133
|
-
},
|
|
2134
|
-
// 纯描边 + 虚线(fill 空)+ round 帽
|
|
2135
|
-
{
|
|
2136
|
-
...base,
|
|
2137
|
-
id: 'kd3',
|
|
2138
|
-
left: 640,
|
|
2139
|
-
top: 240,
|
|
2140
|
-
width: 560,
|
|
2141
|
-
text: 'Outline dash only',
|
|
2142
|
-
fontFamily: 'serif',
|
|
2143
|
-
fontSize: 48,
|
|
2144
|
-
fill: '',
|
|
2145
|
-
stroke: '#803080',
|
|
2146
|
-
strokeWidth: 3,
|
|
2147
|
-
strokeDashArray: [7, 5],
|
|
2148
|
-
strokeLineCap: 'round'
|
|
2149
|
-
},
|
|
2150
|
-
// 逐字样式分段(字体/描边变化处断 run)
|
|
2151
|
-
{
|
|
2152
|
-
...base,
|
|
2153
|
-
id: 'kd4',
|
|
2154
|
-
left: 40,
|
|
2155
|
-
top: 380,
|
|
2156
|
-
width: 560,
|
|
2157
|
-
text: '混排虚线 Mixed',
|
|
2158
|
-
fontFamily: 'sans-serif',
|
|
2159
|
-
fontSize: 48,
|
|
2160
|
-
stroke: '#303030',
|
|
2161
|
-
strokeWidth: 4,
|
|
2162
|
-
strokeDashArray: [10, 6],
|
|
2163
|
-
styles: {
|
|
2164
|
-
0: {
|
|
2165
|
-
2: { fontSize: 64, stroke: '#c06020', fill: 'rgba(255,255,255,0.95)' },
|
|
2166
|
-
3: { fontSize: 64, stroke: '#c06020', fill: 'rgba(255,255,255,0.95)' }
|
|
2167
|
-
}
|
|
2168
|
-
}
|
|
2169
|
-
},
|
|
2170
|
-
// 旋转 + 缩放变换链下的虚线
|
|
2171
|
-
{
|
|
2172
|
-
...base,
|
|
2173
|
-
id: 'kd5',
|
|
2174
|
-
left: 640,
|
|
2175
|
-
top: 420,
|
|
2176
|
-
width: 520,
|
|
2177
|
-
angle: 12,
|
|
2178
|
-
scaleX: 1.1,
|
|
2179
|
-
scaleY: 0.9,
|
|
2180
|
-
text: '旋转虚线 Rotated',
|
|
2181
|
-
fontFamily: 'sans-serif',
|
|
2182
|
-
fontSize: 44,
|
|
2183
|
-
stroke: '#2060a0',
|
|
2184
|
-
strokeWidth: 4,
|
|
2185
|
-
strokeDashArray: [8, 5]
|
|
2186
|
-
}
|
|
2187
|
-
];
|
|
2188
|
-
};
|
|
2189
|
-
/**
|
|
2190
|
-
* 文本 PSD 特效场景(P3-5d:统一剪影管线)。
|
|
2191
|
-
*
|
|
2192
|
-
* 引擎以「文本剪影 → 位图算子」渲染(与图片族同构);参考面是应用侧 Textbox
|
|
2193
|
-
* (_renderTextDropShadow/_renderTextStroke 的逐字矢量路径)——两侧机制不同,
|
|
2194
|
-
* parity 为 AA 级近似(宽容差口径,同文本像素 parity 地板)。
|
|
2195
|
-
* 覆盖:
|
|
2196
|
-
* - fx0/fx1:单层/多层投影(层序:数组序绘制、后层压前层);
|
|
2197
|
-
* - fx2:solidFill 纯色叠加(半透明效果色 × 文字 alpha);
|
|
2198
|
-
* - fx3/fx4/fx5:描边三对齐 outside/center/inside(位图三区间 ↔ main 的
|
|
2199
|
-
* 线宽×2+补填充 / 居中 / 线宽×2+source-atop 三技巧);
|
|
2200
|
-
* - fx6:投影 + 填充 + 双层描边组合(相位序:below 投影 → 内容 → above 填充/描边);
|
|
2201
|
-
* - fx7:多行 + 逐字 fill/fontSize(剪影源逐字字体四件套)+ 旋转缩放链;
|
|
2202
|
-
* - fx8:效果层偏移(offsetEnable + offsetX/Y,_renderStrokeCommon 的整层平移);
|
|
2203
|
-
* - fx9:半透明对象(opacity)× 投影/填充(烘焙层随对象 opacity 调制)。
|
|
2204
|
-
* 文本族描边对齐走 `position` 字段(psd-lib 形态);fontSize 偏大稀释 hinting 差。
|
|
2205
|
-
*/
|
|
2206
|
-
export const makeTextFxScene = () => {
|
|
2207
|
-
const base = {
|
|
2208
|
-
type: 'textbox',
|
|
2209
|
-
scaleX: 1,
|
|
2210
|
-
scaleY: 1,
|
|
2211
|
-
angle: 0,
|
|
2212
|
-
originX: 'left',
|
|
2213
|
-
originY: 'top',
|
|
2214
|
-
opacity: 1,
|
|
2215
|
-
strokeWidth: 0,
|
|
2216
|
-
visible: true,
|
|
2217
|
-
width: 480,
|
|
2218
|
-
fontFamily: 'sans-serif',
|
|
2219
|
-
fontSize: 40,
|
|
2220
|
-
lineHeight: 1.3,
|
|
2221
|
-
charSpacing: 0,
|
|
2222
|
-
textAlign: 'left',
|
|
2223
|
-
fill: '#c8c8c8'
|
|
2224
|
-
};
|
|
2225
|
-
const shadow = (fill, blur, offsetX, offsetY) => ({ enabled: true, showInDialog: true, fill, blur, offsetX, offsetY });
|
|
2226
|
-
const solid = (fill, extra = {}) => ({ enabled: true, showInDialog: true, fillType: 0, fill, ...extra });
|
|
2227
|
-
// 文本族宽度走 size.value(main _setEffectStrokeStyles 只认它;strokeWidth 是图片族字段)
|
|
2228
|
-
// fillType 'color'(字符串——文本族 schema,main _setEffectStrokeStyles 以它分派色源;
|
|
2229
|
-
// 图片族的数字 fillType 是 solidFill 的字段,别混淆)
|
|
2230
|
-
const stroke = (fill, value, position, extra = {}) => ({
|
|
2231
|
-
enabled: true,
|
|
2232
|
-
showInDialog: true,
|
|
2233
|
-
fill,
|
|
2234
|
-
fillType: 'color',
|
|
2235
|
-
size: { value },
|
|
2236
|
-
position,
|
|
2237
|
-
...extra
|
|
2238
|
-
});
|
|
2239
|
-
const fx = (effects) => ({
|
|
2240
|
-
stroke: [],
|
|
2241
|
-
solidFill: [],
|
|
2242
|
-
dropShadow: [],
|
|
2243
|
-
outerGlow: { enabled: true, showInDialog: true },
|
|
2244
|
-
gradientOverlay: [],
|
|
2245
|
-
...effects
|
|
2246
|
-
});
|
|
2247
|
-
return [
|
|
2248
|
-
{ ...base, id: 'fx0', left: 80, top: 30, text: 'Shadow 投影一层', effects: fx({ dropShadow: [shadow('rgba(40,40,80,0.45)', 10, 8, 8)] }) },
|
|
2249
|
-
{
|
|
2250
|
-
...base,
|
|
2251
|
-
id: 'fx1',
|
|
2252
|
-
left: 660,
|
|
2253
|
-
top: 30,
|
|
2254
|
-
text: '多层投影 Multi shadow',
|
|
2255
|
-
effects: fx({ dropShadow: [shadow('rgba(160,60,60,0.4)', 12, 12, 6), shadow('rgba(40,60,160,0.35)', 6, -8, 12)] })
|
|
2256
|
-
},
|
|
2257
|
-
{ ...base, id: 'fx2', left: 80, top: 150, text: 'Color overlay 色叠加', effects: fx({ solidFill: [solid('rgba(30,140,140,0.55)')] }) },
|
|
2258
|
-
{ ...base, id: 'fx3', left: 660, top: 150, text: '描边外 Outside', effects: fx({ stroke: [stroke('rgba(200,60,60,0.95)', 10, 'outside')] }) },
|
|
2259
|
-
{ ...base, id: 'fx4', left: 80, top: 270, text: '描边居中 Center', effects: fx({ stroke: [stroke('rgba(230,140,40,0.95)', 10, 'center')] }) },
|
|
2260
|
-
{ ...base, id: 'fx5', left: 660, top: 270, text: '描边内 Inside', effects: fx({ stroke: [stroke('rgba(40,160,90,0.95)', 8, 'inside')] }) },
|
|
2261
|
-
{
|
|
2262
|
-
...base,
|
|
2263
|
-
id: 'fx6',
|
|
2264
|
-
left: 80,
|
|
2265
|
-
top: 390,
|
|
2266
|
-
text: '组合特效 Combo',
|
|
2267
|
-
effects: fx({
|
|
2268
|
-
dropShadow: [shadow('rgba(30,30,60,0.4)', 8, 6, 10)],
|
|
2269
|
-
solidFill: [solid('rgba(200,200,80,0.5)')],
|
|
2270
|
-
stroke: [stroke('rgba(60,60,200,0.95)', 5, 'outside'), stroke('rgba(20,20,40,0.9)', 14, 'outside')]
|
|
2271
|
-
})
|
|
2272
|
-
},
|
|
2273
|
-
{
|
|
2274
|
-
...base,
|
|
2275
|
-
id: 'fx7',
|
|
2276
|
-
left: 660,
|
|
2277
|
-
top: 390,
|
|
2278
|
-
angle: 12,
|
|
2279
|
-
scaleX: 1.15,
|
|
2280
|
-
scaleY: 0.9,
|
|
2281
|
-
text: '逐字混排 Rich\neffects 字号',
|
|
2282
|
-
styles: { 0: { 0: { fill: '#e0e0e0', fontSize: 48 }, 1: { fill: '#a0a0a0', fontSize: 48 }, 5: { fontSize: 30 } } },
|
|
2283
|
-
effects: fx({ dropShadow: [shadow('rgba(60,30,60,0.45)', 9, 7, 9)], stroke: [stroke('rgba(120,40,160,0.9)', 6, 'outside')] })
|
|
2284
|
-
},
|
|
2285
|
-
{
|
|
2286
|
-
...base,
|
|
2287
|
-
id: 'fx8',
|
|
2288
|
-
left: 80,
|
|
2289
|
-
top: 510,
|
|
2290
|
-
text: '效果偏移 Offset',
|
|
2291
|
-
effects: fx({ stroke: [stroke('rgba(200,60,60,0.9)', 6, 'outside', { offsetEnable: true, offsetX: 12, offsetY: 6 })] })
|
|
2292
|
-
},
|
|
2293
|
-
{
|
|
2294
|
-
...base,
|
|
2295
|
-
id: 'fx9',
|
|
2296
|
-
left: 660,
|
|
2297
|
-
top: 510,
|
|
2298
|
-
opacity: 0.6,
|
|
2299
|
-
text: '半透明 Opacity',
|
|
2300
|
-
effects: fx({ dropShadow: [shadow('rgba(30,30,80,0.5)', 10, 8, 8)], solidFill: [solid('rgba(220,120,60,0.6)')] })
|
|
2301
|
-
}
|
|
2302
|
-
];
|
|
2303
|
-
};
|
|
2304
|
-
/**
|
|
2305
|
-
* 文本全家桶场景:文本 / 描边文本 / 装饰文本 / 文本特效 / 变形文本 / 弧形圆形
|
|
2306
|
-
* 文本 / 竖排文本七个子场景 + 组合场景(P4-1)合并进同一画板——组合借此获得
|
|
2307
|
-
* 页面按钮可见性(单场景路由 ?scene=group 保留,e2e 仍走单场景)。
|
|
2308
|
-
*
|
|
2309
|
-
* 合并只平移 left/top(其余属性零改动),子场景对象直接复用——parity 契约仍是
|
|
2310
|
-
* 「同一份 JSON 双渲染」,且各子场景的 id 前缀(t/k/d/fx/wp/ac/ci/vt/gr)互不冲突。
|
|
2311
|
-
* 带 effects 的 fx 节点与 wp 变形 / ac/ci 弧形圆形 / vt 竖排节点(像素形变、
|
|
2312
|
-
* 逐字摆位与竖排布局姿态是应用定制)在参考渲染器里逐节点走应用侧类,与干净
|
|
2313
|
-
* fabric 的其余节点混排天然兼容(renderFabricReference 按节点分派,非按场景)。
|
|
2314
|
-
*
|
|
2315
|
-
* 2×4 分区,槽位 1300×950(各子场景的实测外接:文本 1180×860 / 描边 1200×535 /
|
|
2316
|
-
* 装饰 1260×540 / 特效 1140×570 + 投影出血 ~30 / 变形 ~930×650(warp 烘焙 quad
|
|
2317
|
-
* 的 arch/flag 出血已含,wp0 顶部出血 ~6px 落进槽间隙)/ 弧形圆形 ~885×660 /
|
|
2318
|
-
* 竖排 ~976×780(vt 系 origin center + angle:90 的变换后四角并集,x 107..1083
|
|
2319
|
-
* y 80..860)/ 组合 ~1060×400(gr0–gr6 旋转出血已含,2026-09-22 框随内容校准后收紧;含图片子加载链与
|
|
2320
|
-
* 半透明组),槽内均留 ≥40 间隙):
|
|
2321
|
-
* - 左上 makeTextScene、右上 makeStrokeTextScene;
|
|
2322
|
-
* - 左中 makeDecorationTextScene、右中 makeTextFxScene;
|
|
2323
|
-
* - 左下 makeWarpTextScene、右下 makeArcCircleTextScene;
|
|
2324
|
-
* - 左底 makeVerticalTextScene、右底 makeGroupScene。
|
|
2325
|
-
* 画板整体 ≈ 2510×3710(组合槽内容止于 y≈3500——gr9/gr10 混合组第三行 y 480..650,
|
|
2326
|
-
* 未撑高画板);视口小于画布时两侧同窗裁剪,parity 比对不受影响。
|
|
2327
|
-
*/
|
|
2328
|
-
export const makeTextAllScene = () => {
|
|
2329
|
-
const place = (objects, dx, dy) => objects.map((o) => ({ ...o, left: (o.left ?? 0) + dx, top: (o.top ?? 0) + dy }));
|
|
2330
|
-
return [
|
|
2331
|
-
...place(makeTextScene(), 0, 0),
|
|
2332
|
-
...place(makeStrokeTextScene(), 1300, 0),
|
|
2333
|
-
...place(makeDecorationTextScene(), 0, 950),
|
|
2334
|
-
...place(makeTextFxScene(), 1300, 950),
|
|
2335
|
-
...place(makeWarpTextScene(), 0, 1900),
|
|
2336
|
-
...place(makeArcCircleTextScene(), 1300, 1900),
|
|
2337
|
-
...place(makeVerticalTextScene(), 0, 2850),
|
|
2338
|
-
...place(makeGroupScene(), 1300, 2850)
|
|
2339
|
-
];
|
|
2340
|
-
};
|
|
2341
|
-
/**
|
|
2342
|
-
* 图片全家桶场景:图片 / PSD 效果 / 拼图 / 图片裁剪四个场景合并进同一画板
|
|
2343
|
-
* (合并只平移 left/top,id 前缀 img/psd/pz/cr 互不冲突;裁剪场景此前只有
|
|
2344
|
-
* debug API 无页面入口,随本合并获得可见性;e2e 仍走各单场景 debug 方法——
|
|
2345
|
-
* 逐场景视口适配 + 分场景容差)。
|
|
2346
|
-
*
|
|
2347
|
-
* 分区(各子场景实测外接:图片 ~3283×2426(2000×1400 撒点域 + 翻转旋转缩放
|
|
2348
|
-
* 出血,x −510..2773 → 平移 +600 后 90..3373)/ PSD 效果 ~1168×644(14 对象,
|
|
2349
|
-
* 投影/纯色/渐变叠加)/ 拼图 ~1124×684 / 裁剪 ~882×491,内容间均 ≥90 间隙):
|
|
2350
|
-
* - 顶行 makeImageScene(60)@(600,0);
|
|
2351
|
-
* - 次行左 makePsdEffectsScene@(600,2500)、右 makePuzzleScene@(2100,2500);
|
|
2352
|
-
* - 三行 makeCropImageScene@(600,3300);
|
|
2353
|
-
* - 底行 makeFilterImageScene@(600,4200)(40 对象,4 列 × 10 行,外接 ≈ 920×2400)。
|
|
2354
|
-
* 画板整体 ≈ 3373×6620;视口小于画板时两侧同窗裁剪,parity 比对不受影响。
|
|
2355
|
-
*/
|
|
2356
|
-
export const makeImageAllScene = () => {
|
|
2357
|
-
const place = (objects, dx, dy) => objects.map((o) => ({ ...o, left: (o.left ?? 0) + dx, top: (o.top ?? 0) + dy }));
|
|
2358
|
-
return [
|
|
2359
|
-
...place(makeImageScene(60, 7), 600, 0),
|
|
2360
|
-
...place(makePsdEffectsScene(), 600, 2500),
|
|
2361
|
-
...place(makePuzzleScene(), 2100, 2500),
|
|
2362
|
-
...place(makeCropImageScene(), 600, 3300),
|
|
2363
|
-
...place(makeFilterImageScene(), 600, 4200)
|
|
2364
|
-
];
|
|
2365
|
-
};
|
|
2366
|
-
/**
|
|
2367
|
-
* 组场景(Phase 4 P4-1):fabric Group 的变换继承与嵌套 parity。
|
|
2368
|
-
*
|
|
2369
|
-
* 子对象 left/top 为**组中心相对空间**(v6 序列化语义)。组 width/height =
|
|
2370
|
-
* 子内容 bbox(含 stroke 半宽)。2026-09-22 校准:gr1–gr5 手写声明宽高与
|
|
2371
|
-
* 落地墨迹脱节(gr3 框底空 61px / gr5 空 70px / gr4 图片自然尺寸 150×124
|
|
2372
|
-
* 误按 200×140 声明——fabric v6 反序列化信任声明值不重算,引擎同口径,选中
|
|
2373
|
-
* 框因此不贴内容);现按实测墨迹收缩声明框并把子元素平移到新框中心,渲染
|
|
2374
|
-
* 位置漂移 ≤4px(旋转组 pivot 随框心移动)。覆盖:双 rect 平移组 / 组旋转+
|
|
2375
|
-
* 缩放(子随组复合变换)/ 组中组两层变换 / 混合内容(rect+ellipse+path)/
|
|
2376
|
-
* 图片子 / 文本子 / 半透明组(子逐个乘组 opacity)/ 跨类型混合组
|
|
2377
|
-
* (gr7–gr10:文字+矩形 / 图片+矩形 / 图片+文字(−8° 旋转链)/ 三合一)。
|
|
2378
|
-
*/
|
|
2379
|
-
export const makeGroupScene = () => {
|
|
2380
|
-
const child = (over) => ({ scaleX: 1, scaleY: 1, angle: 0, originX: 'left', originY: 'top', opacity: 1, strokeWidth: 0, visible: true, ...over });
|
|
2381
|
-
return [
|
|
2382
|
-
// 双 rect 组(identity 变换——基线)
|
|
2383
|
-
{
|
|
2384
|
-
...child({ type: 'Group', left: 60, top: 50, width: 200, height: 150 }),
|
|
2385
|
-
id: 'gr0',
|
|
2386
|
-
objects: [
|
|
2387
|
-
child({ type: 'rect', id: 'gr0-c0', left: -100, top: -75, width: 120, height: 90, fill: 'rgba(230,120,100,0.95)' }),
|
|
2388
|
-
child({ type: 'rect', id: 'gr0-c1', left: -10, top: -30, width: 110, height: 105, fill: 'rgba(100,150,220,0.95)' })
|
|
2389
|
-
]
|
|
2390
|
-
},
|
|
2391
|
-
// 组旋转 + 缩放(子复合变换)
|
|
2392
|
-
{
|
|
2393
|
-
...child({ type: 'Group', left: 340, top: 40, width: 200, height: 145, angle: 18, scaleX: 1.15, scaleY: 0.85 }),
|
|
2394
|
-
id: 'gr1',
|
|
2395
|
-
objects: [
|
|
2396
|
-
child({ type: 'rect', id: 'gr1-c0', left: -100, top: -72.5, width: 130, height: 70, fill: 'rgba(160,110,210,0.95)' }),
|
|
2397
|
-
child({ type: 'ellipse', id: 'gr1-c1', left: 10, top: -37.5, rx: 45, ry: 55, fill: 'rgba(120,200,150,0.95)' })
|
|
2398
|
-
]
|
|
2399
|
-
},
|
|
2400
|
-
// 组中组(两层变换)。2026-09-22 登记:gr2 框不贴内容(嵌套组 25° 旋转簇
|
|
2401
|
-
// 右下角戳出 ~18px)为 seed 声明值与墨迹脱节——但多次重校准实验触发引擎与
|
|
2402
|
-
// fabric 的组内子元素摆放分歧(内容中心差 ~20px,组场景 parity 1.88% vs 基线
|
|
2403
|
-
// ~0.3-0.8%,疑似引擎组子摆放对声明框宽高敏感的缺陷),已回滚原始值维持
|
|
2404
|
-
// parity 绿;框贴合议题移交引擎侧排查后重新定框。
|
|
2405
|
-
{
|
|
2406
|
-
...child({ type: 'Group', left: 640, top: 60, width: 210, height: 170, angle: -12 }),
|
|
2407
|
-
id: 'gr2',
|
|
2408
|
-
objects: [
|
|
2409
|
-
child({ type: 'rect', id: 'gr2-c0', left: -105, top: -85, width: 90, height: 170, fill: 'rgba(240,200,90,0.95)' }),
|
|
2410
|
-
{
|
|
2411
|
-
...child({ type: 'Group', left: -5, top: -60, width: 110, height: 120, angle: 25, scaleX: 0.9, scaleY: 1.1 }),
|
|
2412
|
-
id: 'gr2-inner',
|
|
2413
|
-
objects: [
|
|
2414
|
-
child({ type: 'rect', id: 'gr2-i0', left: -55, top: -60, width: 110, height: 55, fill: 'rgba(80,140,190,0.95)' }),
|
|
2415
|
-
child({ type: 'rect', id: 'gr2-i1', left: -40, top: 0, width: 80, height: 60, fill: 'rgba(200,90,120,0.95)' })
|
|
2416
|
-
]
|
|
2417
|
-
}
|
|
2418
|
-
]
|
|
2419
|
-
},
|
|
2420
|
-
// 混合内容:path + 描边 shape
|
|
2421
|
-
{
|
|
2422
|
-
...child({ type: 'Group', left: 60, top: 300, width: 229, height: 99, angle: 8 }),
|
|
2423
|
-
id: 'gr3',
|
|
2424
|
-
objects: [
|
|
2425
|
-
child({ type: 'Path', id: 'gr3-c0', left: -114.5, top: -49.5, fill: 'rgba(90,170,180,0.95)', path: 'M 10 90 C 40 10 130 10 160 90 C 110 130 50 130 10 90 Z' }),
|
|
2426
|
-
child({
|
|
2427
|
-
type: 'polygon',
|
|
2428
|
-
id: 'gr3-c1',
|
|
2429
|
-
left: 40.5,
|
|
2430
|
-
top: -29.5,
|
|
2431
|
-
fill: 'rgba(250,240,210,0.95)',
|
|
2432
|
-
stroke: 'rgba(150,60,60,0.95)',
|
|
2433
|
-
strokeWidth: 4,
|
|
2434
|
-
points: [
|
|
2435
|
-
{ x: 0, y: 0 },
|
|
2436
|
-
{ x: 70, y: 10 },
|
|
2437
|
-
{ x: 55, y: 75 },
|
|
2438
|
-
{ x: 5, y: 60 }
|
|
2439
|
-
]
|
|
2440
|
-
})
|
|
2441
|
-
]
|
|
2442
|
-
},
|
|
2443
|
-
// 图片子(加载链;greyfloral 自然尺寸 150×124——框随内容)
|
|
2444
|
-
{
|
|
2445
|
-
...child({ type: 'Group', left: 360, top: 300, width: 150, height: 124, scaleX: 1.1 }),
|
|
2446
|
-
id: 'gr4',
|
|
2447
|
-
objects: [child({ type: 'image', id: 'gr4-c0', left: -75, top: -62, src: assetUrl('../../assets/images/greyfloral.png') })]
|
|
2448
|
-
},
|
|
2449
|
-
// 文本子(排版 + 字体链;单行 44px×1.16≈51 高——框随内容)
|
|
2450
|
-
{
|
|
2451
|
-
...child({ type: 'Group', left: 640, top: 310, width: 230, height: 51, angle: -6 }),
|
|
2452
|
-
id: 'gr5',
|
|
2453
|
-
objects: [child({ type: 'textbox', id: 'gr5-t0', left: -115, top: -25.5, width: 230, text: '组内文本', fontFamily: 'sans-serif', fontSize: 44, fill: 'rgba(40,40,70,0.95)', lineHeight: 1.16 })]
|
|
2454
|
-
},
|
|
2455
|
-
// 半透明组
|
|
2456
|
-
{
|
|
2457
|
-
...child({ type: 'Group', left: 920, top: 60, width: 190, height: 150, opacity: 0.55, angle: 10 }),
|
|
2458
|
-
id: 'gr6',
|
|
2459
|
-
objects: [
|
|
2460
|
-
child({ type: 'rect', id: 'gr6-c0', left: -95, top: -75, width: 190, height: 150, fill: 'rgba(60,180,120,1)' }),
|
|
2461
|
-
child({ type: 'circle', id: 'gr6-c1', left: -45, top: -45, radius: 45, fill: 'rgba(240,240,240,1)' })
|
|
2462
|
-
]
|
|
2463
|
-
},
|
|
2464
|
-
// ── 混合类型组(2026-09-23 用户点名补案例:下钻/虚线 topGroup 在跨类型
|
|
2465
|
-
// 子元素上的验证面。声明框按墨迹外接校准——gr9 含图片+文本两段内容,
|
|
2466
|
-
// 外接 = x −75..75 × y −79.5..72.2(20px 字号 ×1.16 行高)──
|
|
2467
|
-
// 文字+矩形(徽标:底板 rect 上叠文本,identity 变换基线)
|
|
2468
|
-
{
|
|
2469
|
-
...child({ type: 'Group', left: 920, top: 300, width: 200, height: 70 }),
|
|
2470
|
-
id: 'gr7',
|
|
2471
|
-
objects: [
|
|
2472
|
-
child({ type: 'rect', id: 'gr7-r0', left: -100, top: -35, width: 200, height: 70, fill: 'rgba(250,235,205,0.95)' }),
|
|
2473
|
-
child({ type: 'textbox', id: 'gr7-t0', left: -92, top: -16, width: 184, text: '矩形+文字', fontFamily: 'sans-serif', fontSize: 28, fill: 'rgba(60,50,30,0.95)', lineHeight: 1.16 })
|
|
2474
|
-
]
|
|
2475
|
-
},
|
|
2476
|
-
// 图片+矩形(拍立得衬底:image 用 greyfloral 自然尺寸 150×124,居中垫在底板上)
|
|
2477
|
-
{
|
|
2478
|
-
...child({ type: 'Group', left: 60, top: 480, width: 190, height: 130 }),
|
|
2479
|
-
id: 'gr8',
|
|
2480
|
-
objects: [
|
|
2481
|
-
child({ type: 'rect', id: 'gr8-r0', left: -95, top: -65, width: 190, height: 130, fill: 'rgba(245,228,196,0.95)' }),
|
|
2482
|
-
child({ type: 'image', id: 'gr8-i0', left: -75, top: -62, src: assetUrl('../../assets/images/greyfloral.png') })
|
|
2483
|
-
]
|
|
2484
|
-
},
|
|
2485
|
-
// 图片+文字(上图下文;组旋转 −8°——跨类型子随组链变换)
|
|
2486
|
-
{
|
|
2487
|
-
...child({ type: 'Group', left: 300, top: 480, width: 150, height: 152, angle: -8 }),
|
|
2488
|
-
id: 'gr9',
|
|
2489
|
-
objects: [
|
|
2490
|
-
child({ type: 'image', id: 'gr9-i0', left: -75, top: -79.5, src: assetUrl('../../assets/images/greyfloral.png') }),
|
|
2491
|
-
child({ type: 'textbox', id: 'gr9-t0', left: -75, top: 49, width: 150, text: '图片配文', fontFamily: 'sans-serif', fontSize: 20, fill: 'rgba(40,40,70,0.95)', lineHeight: 1.16 })
|
|
2492
|
-
]
|
|
2493
|
-
},
|
|
2494
|
-
// 图片+文字+矩形(三合一卡片:底板 / 图 / 底部说明文字)
|
|
2495
|
-
{
|
|
2496
|
-
...child({ type: 'Group', left: 580, top: 480, width: 240, height: 170 }),
|
|
2497
|
-
id: 'gr10',
|
|
2498
|
-
objects: [
|
|
2499
|
-
child({ type: 'rect', id: 'gr10-r0', left: -120, top: -85, width: 240, height: 170, fill: 'rgba(248,248,252,0.95)' }),
|
|
2500
|
-
child({ type: 'image', id: 'gr10-i0', left: -95, top: -70, src: assetUrl('../../assets/images/greyfloral.png') }),
|
|
2501
|
-
child({ type: 'textbox', id: 'gr10-t0', left: -100, top: 58, width: 200, text: '图+文+矩形', fontFamily: 'sans-serif', fontSize: 20, fill: 'rgba(40,40,70,0.95)', lineHeight: 1.16 })
|
|
2502
|
-
]
|
|
2503
|
-
}
|
|
2504
|
-
];
|
|
2505
|
-
};
|
|
2506
|
-
/**
|
|
2507
|
-
* 组蒙版与隔离场景(Phase 4 P4-2):FBO 离屏合成 parity。
|
|
2508
|
-
*
|
|
2509
|
-
* 蒙版 = 灰度位图(白显黑隐);defaultColor 255 = coversHost(蒙版矩形外保持
|
|
2510
|
-
* 可见),0 = 矩形外裁掉。覆盖:径向灰度蒙版 / coversHost / 蒙版+组透明 /
|
|
2511
|
-
* 纯隔离(半透明组重叠子——P4-1 gr6 语义收口)/ 蒙版×旋转缩放链。
|
|
2512
|
-
*/
|
|
2513
|
-
export const makeGroupMaskScene = () => {
|
|
2514
|
-
const base = (over) => ({ type: 'Group', scaleX: 1, scaleY: 1, angle: 0, originX: 'left', originY: 'top', opacity: 1, strokeWidth: 0, visible: true, ...over });
|
|
2515
|
-
const child = (over) => ({ scaleX: 1, scaleY: 1, angle: 0, originX: 'left', originY: 'top', opacity: 1, strokeWidth: 0, visible: true, ...over });
|
|
2516
|
-
// 灰度蒙版(SVG data URL,radial 白→黑)
|
|
2517
|
-
const radialMask = (r, g, b) => `data:image/svg+xml;utf8,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${g}"><defs><radialGradient id="m" cx="0.5" cy="0.5" r="0.5"><stop offset="0" stop-color="#ffffff"/><stop offset="0.7" stop-color="#808080"/><stop offset="1" stop-color="#000000"/></radialGradient></defs><rect width="${r}" height="${g}" fill="url(#m)"/></svg>`).replace('REMOVED', String(b))}`;
|
|
2518
|
-
return [
|
|
2519
|
-
// 径向蒙版(defaultColor 0:矩形外裁掉)
|
|
2520
|
-
{
|
|
2521
|
-
...base({ left: 60, top: 50, width: 200, height: 150, mask: { src: radialMask(200, 150, 0), offsetX: 0, offsetY: 0, width: 200, height: 150, scaleX: 1, scaleY: 1, defaultColor: 0 } }),
|
|
2522
|
-
id: 'gm0',
|
|
2523
|
-
objects: [
|
|
2524
|
-
child({ type: 'rect', left: -100, top: -75, width: 130, height: 150, fill: 'rgba(230,120,100,1)' }),
|
|
2525
|
-
child({ type: 'rect', left: -30, top: -75, width: 130, height: 150, fill: 'rgba(100,150,220,1)' })
|
|
2526
|
-
]
|
|
2527
|
-
},
|
|
2528
|
-
// coversHost(defaultColor 255:蒙版矩形外可见)
|
|
2529
|
-
{
|
|
2530
|
-
...base({ left: 340, top: 50, width: 200, height: 150, mask: { src: radialMask(120, 90, 255), offsetX: -40, offsetY: -30, width: 120, height: 90, scaleX: 1, scaleY: 1, defaultColor: 255 } }),
|
|
2531
|
-
id: 'gm1',
|
|
2532
|
-
objects: [child({ type: 'rect', left: -100, top: -75, width: 200, height: 150, fill: 'rgba(120,200,150,1)' })]
|
|
2533
|
-
},
|
|
2534
|
-
// 蒙版 + 组透明(隔离 + destination-in + opacity 复合)
|
|
2535
|
-
{
|
|
2536
|
-
...base({
|
|
2537
|
-
left: 640,
|
|
2538
|
-
top: 50,
|
|
2539
|
-
width: 200,
|
|
2540
|
-
height: 150,
|
|
2541
|
-
opacity: 0.6,
|
|
2542
|
-
mask: { src: radialMask(200, 150, 0), offsetX: 0, offsetY: 0, width: 200, height: 150, scaleX: 1, scaleY: 1, defaultColor: 0 }
|
|
2543
|
-
}),
|
|
2544
|
-
id: 'gm2',
|
|
2545
|
-
objects: [
|
|
2546
|
-
child({ type: 'rect', left: -100, top: -75, width: 200, height: 150, fill: 'rgba(200,160,60,1)' }),
|
|
2547
|
-
child({ type: 'circle', left: -40, top: -55, radius: 55, fill: 'rgba(240,240,240,1)' })
|
|
2548
|
-
]
|
|
2549
|
-
},
|
|
2550
|
-
// 纯隔离(半透明组重叠子——fabric 缓存单元合成语义)
|
|
2551
|
-
{
|
|
2552
|
-
...base({ left: 60, top: 300, width: 200, height: 150, opacity: 0.55, angle: 8 }),
|
|
2553
|
-
id: 'gm3',
|
|
2554
|
-
objects: [
|
|
2555
|
-
child({ type: 'rect', left: -100, top: -75, width: 200, height: 150, fill: 'rgba(60,180,120,1)' }),
|
|
2556
|
-
child({ type: 'circle', left: -45, top: -45, radius: 45, fill: 'rgba(240,240,240,1)' })
|
|
2557
|
-
]
|
|
2558
|
-
},
|
|
2559
|
-
// 蒙版 × 旋转缩放(摆放矩形随组矩阵)
|
|
2560
|
-
{
|
|
2561
|
-
...base({
|
|
2562
|
-
left: 340,
|
|
2563
|
-
top: 320,
|
|
2564
|
-
width: 200,
|
|
2565
|
-
height: 150,
|
|
2566
|
-
angle: 18,
|
|
2567
|
-
scaleX: 1.15,
|
|
2568
|
-
scaleY: 0.85,
|
|
2569
|
-
mask: { src: radialMask(200, 150, 0), offsetX: 0, offsetY: 0, width: 200, height: 150, scaleX: 1, scaleY: 1, defaultColor: 0 }
|
|
2570
|
-
}),
|
|
2571
|
-
id: 'gm4',
|
|
2572
|
-
objects: [
|
|
2573
|
-
child({ type: 'rect', left: -100, top: -75, width: 200, height: 150, fill: 'rgba(150,110,210,1)' }),
|
|
2574
|
-
child({ type: 'rect', left: -60, top: -40, width: 90, height: 90, fill: 'rgba(250,220,120,1)' })
|
|
2575
|
-
]
|
|
2576
|
-
}
|
|
2577
|
-
];
|
|
2578
|
-
};
|
|
2579
|
-
/**
|
|
2580
|
-
* clipPath 场景(Phase 4 P4-3):矢量裁剪 parity。
|
|
2581
|
-
*
|
|
2582
|
-
* clipPath = 形状族描述(rect/ellipse/Path/polygon),fabric 语义:宿主经
|
|
2583
|
-
* 私有缓存 + destination-in 合成剪影;absolutePositioned = 场景坐标
|
|
2584
|
-
* (缺省为宿主本地系);inverted = destination-out(裁剪取反)。
|
|
2585
|
-
* 覆盖:rect 裁图片 / 椭圆裁形状 / Path 曲线裁 rect / inverted /
|
|
2586
|
-
* absolutePositioned / 带变换链宿主。
|
|
2587
|
-
*/
|
|
2588
|
-
export const makeClipPathScene = () => {
|
|
2589
|
-
const base = (over) => ({ scaleX: 1, scaleY: 1, angle: 0, originX: 'left', originY: 'top', opacity: 1, strokeWidth: 0, visible: true, ...over });
|
|
2590
|
-
return [
|
|
2591
|
-
// rect 裁图片(角落窗口)
|
|
2592
|
-
{
|
|
2593
|
-
...base({ type: 'image', left: 60, top: 50, src: assetUrl('../../assets/images/nasty_fabric.png') }),
|
|
2594
|
-
id: 'cp0',
|
|
2595
|
-
clipPath: { type: 'rect', left: 40, top: 30, width: 100, height: 120 }
|
|
2596
|
-
},
|
|
2597
|
-
// 椭圆裁形状
|
|
2598
|
-
{
|
|
2599
|
-
...base({ type: 'rect', left: 320, top: 50, width: 200, height: 150, fill: 'rgba(120,160,220,0.95)' }),
|
|
2600
|
-
id: 'cp1',
|
|
2601
|
-
clipPath: { type: 'ellipse', left: 30, top: 15, rx: 70, ry: 60 }
|
|
2602
|
-
},
|
|
2603
|
-
// Path 曲线裁 rect
|
|
2604
|
-
{
|
|
2605
|
-
...base({ type: 'rect', left: 600, top: 50, width: 220, height: 150, fill: 'rgba(230,150,90,0.95)' }),
|
|
2606
|
-
id: 'cp2',
|
|
2607
|
-
clipPath: { type: 'Path', left: 20, top: 10, path: 'M 0 0 C 60 -30 140 30 180 0 C 160 80 80 130 0 110 Z' }
|
|
2608
|
-
},
|
|
2609
|
-
// inverted(保留形状外)
|
|
2610
|
-
{
|
|
2611
|
-
...base({ type: 'rect', left: 60, top: 320, width: 200, height: 150, fill: 'rgba(160,110,210,0.95)' }),
|
|
2612
|
-
id: 'cp3',
|
|
2613
|
-
clipPath: { type: 'ellipse', left: 50, top: 35, rx: 50, ry: 40, inverted: true }
|
|
2614
|
-
},
|
|
2615
|
-
// absolutePositioned(场景坐标椭圆,宿主旋转)
|
|
2616
|
-
{
|
|
2617
|
-
...base({ type: 'rect', left: 320, top: 320, width: 200, height: 150, angle: 15, fill: 'rgba(100,200,150,0.95)' }),
|
|
2618
|
-
id: 'cp4',
|
|
2619
|
-
clipPath: { type: 'ellipse', left: 350, top: 340, rx: 60, ry: 50, absolutePositioned: true }
|
|
2620
|
-
},
|
|
2621
|
-
// 裁剪 + 宿主半透明(隔离复合 × clip)
|
|
2622
|
-
// 注:textbox+clipPath 在 fabric 参考面走直绘路径崩溃(main 同缺陷——该组合
|
|
2623
|
-
// 的引擎支持保留,parity 种子规避)
|
|
2624
|
-
{
|
|
2625
|
-
...base({
|
|
2626
|
-
type: 'polygon',
|
|
2627
|
-
left: 600,
|
|
2628
|
-
top: 330,
|
|
2629
|
-
opacity: 0.7,
|
|
2630
|
-
fill: 'rgba(40,40,80,0.9)',
|
|
2631
|
-
points: [
|
|
2632
|
-
{ x: 0, y: 0 },
|
|
2633
|
-
{ x: 220, y: 20 },
|
|
2634
|
-
{ x: 180, y: 140 },
|
|
2635
|
-
{ x: 20, y: 130 }
|
|
2636
|
-
]
|
|
2637
|
-
}),
|
|
2638
|
-
id: 'cp5',
|
|
2639
|
-
clipPath: { type: 'rect', left: 10, top: 10, width: 120, height: 70 }
|
|
2640
|
-
}
|
|
2641
|
-
];
|
|
2642
|
-
};
|
|
2643
|
-
/**
|
|
2644
|
-
* 变形文本场景(Phase 4 P4-5a):ArchText/WaistText/FlagText 的像素形变 parity。
|
|
2645
|
-
* warpStrength ∈ [-1,1];参考面 = 应用类(像素形变是应用定制)。
|
|
2646
|
-
*/
|
|
2647
|
-
export const makeWarpTextScene = () => {
|
|
2648
|
-
const base = (over) => ({ scaleX: 1, scaleY: 1, angle: 0, originX: 'left', originY: 'top', opacity: 1, strokeWidth: 0, visible: true, fontFamily: 'sans-serif', lineHeight: 1.16, ...over });
|
|
2649
|
-
return [
|
|
2650
|
-
{ ...base({ type: 'ArchText', left: 60, top: 40, width: 380, text: '拱形凸起', fontSize: 48, fill: 'rgba(40,60,140,0.95)', warpStrength: 0.6 }), id: 'wp0' },
|
|
2651
|
-
{ ...base({ type: 'ArchText', left: 500, top: 40, width: 380, text: '凹陷下沉', fontSize: 48, fill: 'rgba(160,60,60,0.95)', warpStrength: -0.5 }), id: 'wp1' },
|
|
2652
|
-
{ ...base({ type: 'WaistText', left: 60, top: 260, width: 380, text: '腰线捏合', fontSize: 48, fill: 'rgba(40,130,90,0.95)', warpStrength: 0.7 }), id: 'wp2' },
|
|
2653
|
-
{ ...base({ type: 'WaistText', left: 500, top: 260, width: 380, text: '腰线展开', fontSize: 48, fill: 'rgba(150,100,180,0.95)', warpStrength: -0.6 }), id: 'wp3' },
|
|
2654
|
-
{ ...base({ type: 'FlagText', left: 60, top: 480, width: 380, text: '波浪旗帜', fontSize: 44, fill: 'rgba(200,140,40,0.95)', warpStrength: 0.8 }), id: 'wp4' },
|
|
2655
|
-
{ ...base({ type: 'ArchText', left: 500, top: 470, width: 400, angle: 8, text: '旋转拱形多行\n第二行文本', fontSize: 40, fill: 'rgba(60,60,60,0.95)', warpStrength: 0.45 }), id: 'wp5' }
|
|
2656
|
-
];
|
|
2657
|
-
};
|
|
2658
|
-
/**
|
|
2659
|
-
* 弧形/圆形文本场景(Phase 4 P4-5b):ArcText/CircleText 逐字摆位 parity。
|
|
2660
|
-
* 参考面 = 应用类(逐字旋转布局是应用定制;ArcText 构造期类字段 clobber 由
|
|
2661
|
-
* 参考面 set() 补拍 initDimensions)。
|
|
2662
|
-
* 覆盖:正/负曲率单行(radius 取 minRadius 分支)、多行 globalOffset 堆叠、
|
|
2663
|
-
* textAlign center 的行偏移、正圆 360 首尾相接 / 椭圆偏心+起始角+部分弧段 /
|
|
2664
|
-
* 水平字向(circleDirection)。
|
|
2665
|
-
* 种子约定(arcLayout 头注的规避带):generic 字体;无 charSpacing(应用侧
|
|
2666
|
-
* bounds 与 charSpacingOffset 双计,未对拍)/ deltaY / justify / effects / 阴影 /
|
|
2667
|
-
* strokeVisible 描边门 / 旋转(ArcText _set('angle') 换 center 锚,另行覆盖)。
|
|
2668
|
-
*/
|
|
2669
|
-
export const makeArcCircleTextScene = () => {
|
|
2670
|
-
const base = (over) => ({ scaleX: 1, scaleY: 1, angle: 0, originX: 'left', originY: 'top', opacity: 1, strokeWidth: 0, visible: true, fontFamily: 'sans-serif', lineHeight: 1.16, ...over });
|
|
2671
|
-
return [
|
|
2672
|
-
{ ...base({ type: 'ArcText', left: 60, top: 50, text: '拱形弯曲文字', fontSize: 44, fill: 'rgba(30,90,150,0.95)', curvature: 80 }), id: 'ac0' },
|
|
2673
|
-
{ ...base({ type: 'ArcText', left: 480, top: 40, text: '下垂弧形文字', fontSize: 44, fill: 'rgba(160,60,90,0.95)', curvature: -60 }), id: 'ac1' },
|
|
2674
|
-
{ ...base({ type: 'ArcText', left: 60, top: 250, text: '两行弧形\n第二行也弯', fontSize: 34, fill: 'rgba(50,120,70,0.95)', curvature: 45 }), id: 'ac2' },
|
|
2675
|
-
{ ...base({ type: 'ArcText', left: 480, top: 240, text: '居中对齐弧形\n次行短', fontSize: 30, fill: 'rgba(120,80,160,0.95)', curvature: 65, textAlign: 'center' }), id: 'ac3' },
|
|
2676
|
-
{ ...base({ type: 'CircleText', left: 70, top: 440, text: '圆形环绕文字', fontSize: 30, fill: 'rgba(180,110,30,0.95)', circleSize: 85, circleSweep: 360 }), id: 'ci0' },
|
|
2677
|
-
{
|
|
2678
|
-
...base({
|
|
2679
|
-
type: 'CircleText',
|
|
2680
|
-
left: 400,
|
|
2681
|
-
top: 440,
|
|
2682
|
-
text: '部分弧段文本',
|
|
2683
|
-
fontSize: 26,
|
|
2684
|
-
fill: 'rgba(30,120,140,0.95)',
|
|
2685
|
-
circleSize: 80,
|
|
2686
|
-
circleStartAngle: 30,
|
|
2687
|
-
circleSweep: 200,
|
|
2688
|
-
circleEccentricity: 0.4
|
|
2689
|
-
}),
|
|
2690
|
-
id: 'ci1'
|
|
2691
|
-
},
|
|
2692
|
-
{
|
|
2693
|
-
...base({ type: 'CircleText', left: 680, top: 440, text: '水平字向环绕', fontSize: 26, fill: 'rgba(90,90,160,0.95)', circleSize: 70, circleSweep: 300, circleDirection: 'horizontal' }),
|
|
2694
|
-
id: 'ci2'
|
|
2695
|
-
}
|
|
2696
|
-
];
|
|
2697
|
-
};
|
|
2698
|
-
/**
|
|
2699
|
-
* 竖排文本场景(Phase 4 P4-5c):vertical:true 的布局与四类字形姿态 parity。
|
|
2700
|
-
*
|
|
2701
|
-
* 参考面 = 应用类(vertical 布局/姿态是应用 Textbox 定制,干净 fabric 不认)。
|
|
2702
|
-
* 对象形态取应用真实口径:vertical + angle:90 + origin center(引擎零角度
|
|
2703
|
-
* 特判——90° 由通用对象矩阵消费,与所有节点一致)。
|
|
2704
|
-
* 覆盖:纯 CJK 多列硬换行 / 中英数字混排(isLatin 双 advance)+ 逐字字号与
|
|
2705
|
-
* 填充覆写 / 括号+标点(四类姿态全档)/ textAlign center 与 right+charSpacing /
|
|
2706
|
-
* lineHeight 列距 / 下划线+背景高亮 / 描边+非 90° 旋转(锁通用矩阵链)。
|
|
2707
|
-
* 种子约定(已知缺口的规避带,见 roadmap P4-5c):generic 字体;无阴影/虚线
|
|
2708
|
-
* 描边/渐变/textOffsetY(抖动未移植);width 取最长原始行横向墨宽 + 20px 余量
|
|
2709
|
-
* ——竖排换行判定轴仍是横向字宽(fabric 原样近似,两侧共享,余量避开容差带);
|
|
2710
|
-
* 不设 height(fabric initDimensions 与引擎 layout.height 同口径重算)。
|
|
2711
|
-
*/
|
|
2712
|
-
export const makeVerticalTextScene = () => {
|
|
2713
|
-
const base = (over) => ({
|
|
2714
|
-
type: 'textbox',
|
|
2715
|
-
scaleX: 1,
|
|
2716
|
-
scaleY: 1,
|
|
2717
|
-
angle: 90,
|
|
2718
|
-
originX: 'center',
|
|
2719
|
-
originY: 'center',
|
|
2720
|
-
opacity: 1,
|
|
2721
|
-
strokeWidth: 0,
|
|
2722
|
-
visible: true,
|
|
2723
|
-
fontFamily: 'sans-serif',
|
|
2724
|
-
lineHeight: 1.16,
|
|
2725
|
-
textAlign: 'left',
|
|
2726
|
-
vertical: true,
|
|
2727
|
-
...over
|
|
2728
|
-
});
|
|
2729
|
-
return [
|
|
2730
|
-
// 纯 CJK 两列(硬换行:行0 = 旋转后最右列,vertical-rl)
|
|
2731
|
-
{ ...base({ left: 170, top: 280, width: 340, text: '竖排文本渲染\n引擎对拍内核', fontSize: 48, fill: 'rgba(26,26,26,0.95)' }), id: 'vt0' },
|
|
2732
|
-
// 中英数字混排:CJK 直立 / 拉丁躺倒双 advance + 逐字字号(advance 走盒高)与填充覆写
|
|
2733
|
-
{
|
|
2734
|
-
...base({
|
|
2735
|
-
left: 400,
|
|
2736
|
-
top: 300,
|
|
2737
|
-
width: 440,
|
|
2738
|
-
text: '中文ABC 123混排',
|
|
2739
|
-
fontSize: 44,
|
|
2740
|
-
fill: 'rgba(30,80,150,0.95)',
|
|
2741
|
-
styles: { 0: { 0: { fontSize: 64 }, 6: { fill: '#c03030' }, 7: { fill: '#c03030' }, 8: { fill: '#c03030' } } }
|
|
2742
|
-
}),
|
|
2743
|
-
id: 'vt1'
|
|
2744
|
-
},
|
|
2745
|
-
// 括号+标点:bracket 平画转向 / symbol 锚点偏移直立 / 普通 CJK 直立全档
|
|
2746
|
-
{ ...base({ left: 640, top: 290, width: 420, text: '「引号」标注。\n、与〜省略…', fontSize: 44, fill: 'rgba(120,60,140,0.95)' }), id: 'vt2' },
|
|
2747
|
-
// textAlign:center 沿列内流向居中
|
|
2748
|
-
{ ...base({ left: 850, top: 280, width: 300, text: '居中对齐竖排\n次列短', fontSize: 40, textAlign: 'center', fill: 'rgba(160,60,90,0.95)' }), id: 'vt3' },
|
|
2749
|
-
// right + charSpacing:列内悬底对齐 + CJK 手动字距(vSpacing 轴)
|
|
2750
|
-
{ ...base({ left: 1060, top: 290, width: 300, text: '右对齐带字距', fontSize: 40, textAlign: 'right', charSpacing: 120, fill: 'rgba(20,110,60,0.95)' }), id: 'vt4' },
|
|
2751
|
-
// lineHeight 列距(竖排下 = 列间距)
|
|
2752
|
-
{ ...base({ left: 170, top: 700, width: 300, text: '松列距竖排\n第二列', fontSize: 40, lineHeight: 1.8, fill: 'rgba(40,40,40,0.95)' }), id: 'vt5' },
|
|
2753
|
-
// 下划线(竖排 run advance 换轴)+ 背景高亮(fabric base 盒 left 链,两侧同构)
|
|
2754
|
-
{
|
|
2755
|
-
...base({
|
|
2756
|
-
left: 410,
|
|
2757
|
-
top: 690,
|
|
2758
|
-
width: 340,
|
|
2759
|
-
text: '装饰线与背景\n高亮混排A',
|
|
2760
|
-
fontSize: 40,
|
|
2761
|
-
fill: 'rgba(20,20,20,0.95)',
|
|
2762
|
-
underline: true,
|
|
2763
|
-
textBackgroundColor: '#ffe08a',
|
|
2764
|
-
styles: { 0: { 5: { fill: '#2060c0' }, 6: { fill: '#2060c0' } } }
|
|
2765
|
-
}),
|
|
2766
|
-
id: 'vt6'
|
|
2767
|
-
},
|
|
2768
|
-
// 描边 + 非 90° 旋转:锁「内部坐标系 + 通用矩阵」等价链(CJK 净转 −45°)。
|
|
2769
|
-
// strokeWidth 取 1:应用 Textbox 构造器无条件强制对象级描边为 1(其 333 行),
|
|
2770
|
-
// 参考面(应用类直构造)与真实数据反序列化后同语义
|
|
2771
|
-
{ ...base({ left: 690, top: 680, width: 320, text: '描边旋转斜置', fontSize: 40, fill: '#2050a0', stroke: '#c03030', strokeWidth: 1, angle: 45 }), id: 'vt7' }
|
|
2772
|
-
];
|
|
2773
|
-
};
|
|
2774
|
-
/**
|
|
2775
|
-
* K-line 垂直偏移场景(批次 61):textOffsetY 隔字抖动(「上下上下」变形,
|
|
2776
|
-
* fabric Textbox._renderStr 2714-2757——偶字平、奇字 (textOffsetY/300)·fontSize/2)。
|
|
2777
|
-
*
|
|
2778
|
-
* 覆盖:正值最强档 / 负值上移 + 逐字 fontSize 抬峰 / 硬换行跨行奇偶连续
|
|
2779
|
-
* (fabric 全局累计不含 \n)/ 拉丁 + charSpacing / 描边 + 旋转(stroke cell
|
|
2780
|
-
* 同 jitter)/ 虚线描边(renderTextDashStroke 逐字分段 + 抖动 y + 余量扩边)/
|
|
2781
|
-
* 竖排(锚点 y 平移——对象 angle:90 后视觉左右交错)。
|
|
2782
|
-
* 种子约定:generic 字体;描边宽恒 1(应用 Textbox 构造器强制,vt7 同注记);
|
|
2783
|
-
* 无阴影(P3-4 烘焙近似属 shadowBake 已知域,不掺入本对拍);无 justify。
|
|
2784
|
-
*/
|
|
2785
|
-
export const makeKlineTextScene = () => {
|
|
2786
|
-
const base = (over) => ({
|
|
2787
|
-
type: 'textbox',
|
|
2788
|
-
scaleX: 1,
|
|
2789
|
-
scaleY: 1,
|
|
2790
|
-
angle: 0,
|
|
2791
|
-
originX: 'left',
|
|
2792
|
-
originY: 'top',
|
|
2793
|
-
opacity: 1,
|
|
2794
|
-
strokeWidth: 0,
|
|
2795
|
-
visible: true,
|
|
2796
|
-
fontFamily: 'sans-serif',
|
|
2797
|
-
lineHeight: 1.16,
|
|
2798
|
-
textAlign: 'left',
|
|
2799
|
-
fill: 'rgba(26,26,26,0.95)',
|
|
2800
|
-
textOffsetY: 300,
|
|
2801
|
-
...over
|
|
2802
|
-
});
|
|
2803
|
-
return [
|
|
2804
|
-
// 正值最强档:奇字下移 fontSize·0.5
|
|
2805
|
-
{ ...base({ left: 80, top: 60, width: 620, text: '隔字上下交错排列文本', fontSize: 48, fill: 'rgba(26,26,26,0.95)' }), id: 'kl0' },
|
|
2806
|
-
// 负值上移 + 逐字 fontSize 覆写抬峰(偏移量逐字各异)+ 逐字填充
|
|
2807
|
-
{
|
|
2808
|
-
...base({
|
|
2809
|
-
left: 820,
|
|
2810
|
-
top: 60,
|
|
2811
|
-
width: 560,
|
|
2812
|
-
text: 'jitter stagger up',
|
|
2813
|
-
fontSize: 42,
|
|
2814
|
-
textOffsetY: -240,
|
|
2815
|
-
fill: '#101010',
|
|
2816
|
-
styles: { 0: { 2: { fontSize: 60, fill: '#c03030' }, 3: { fill: '#c03030' }, 9: { fill: '#2060c0' } } }
|
|
2817
|
-
}),
|
|
2818
|
-
id: 'kl1'
|
|
2819
|
-
},
|
|
2820
|
-
// 硬换行跨行奇偶连续:次行首字全局位 4(偶=平),行内第 5/7 字抖
|
|
2821
|
-
{ ...base({ left: 80, top: 220, width: 620, text: '多行奇偶跨行\n连续累计判定', fontSize: 40, textOffsetY: 300, lineHeight: 1.4, fill: 'rgba(30,80,150,0.95)' }), id: 'kl2' },
|
|
2822
|
-
// 拉丁 + charSpacing(fabric _renderChars 2496:charSpacing≠0 本就逐字出笔)
|
|
2823
|
-
{ ...base({ left: 820, top: 220, width: 560, text: 'Latin ABC 123 spaced', fontSize: 40, textOffsetY: 180, charSpacing: 60, fill: 'rgba(20,110,60,0.95)' }), id: 'kl3' },
|
|
2824
|
-
// 描边 + 旋转(stroke cell 遍同 jitter;strokeWidth 恒 1 见头注)
|
|
2825
|
-
{ ...base({ left: 80, top: 420, width: 620, text: '描边旋转抖动链', fontSize: 44, textOffsetY: 240, fill: '#2050a0', stroke: '#c03030', strokeWidth: 1, angle: 15 }), id: 'kl4' },
|
|
2826
|
-
// 虚线描边(renderTextDashStroke:逐字断段 + 各字 y + 烘焙余量扩 jitterPad)
|
|
2827
|
-
{
|
|
2828
|
-
...base({ left: 820, top: 420, width: 560, text: 'dashed stroke jitter', fontSize: 42, textOffsetY: 300, fill: '#1a1a1a', stroke: '#2060c0', strokeWidth: 1, strokeDashArray: [8, 6] }),
|
|
2829
|
-
id: 'kl5'
|
|
2830
|
-
},
|
|
2831
|
-
// 竖排:锚点 y 平移(fabric charTop 加偏移后算旋转锚点;angle:90 转竖后视觉左右交错)
|
|
2832
|
-
{
|
|
2833
|
-
...base({
|
|
2834
|
-
left: 1440,
|
|
2835
|
-
top: 80,
|
|
2836
|
-
width: 360,
|
|
2837
|
-
text: '竖排抖动\n锚点交错',
|
|
2838
|
-
fontSize: 40,
|
|
2839
|
-
vertical: true,
|
|
2840
|
-
angle: 90,
|
|
2841
|
-
originX: 'center',
|
|
2842
|
-
originY: 'center',
|
|
2843
|
-
textOffsetY: 300,
|
|
2844
|
-
fill: 'rgba(120,60,140,0.95)'
|
|
2845
|
-
}),
|
|
2846
|
-
id: 'kl6'
|
|
2847
|
-
}
|
|
2848
|
-
];
|
|
2849
|
-
};
|
|
2850
|
-
/**
|
|
2851
|
-
* 划重点场景(批次62):raw.texts 的 svg highlight 段 → 段/行区间切分 +
|
|
2852
|
-
* span 拉伸与 isSingle 逐字两模式(应用 Textbox._renderHighlight parity)。
|
|
2853
|
-
*
|
|
2854
|
-
* mark path 取自应用 TextMark 真实配置(configs/texts.ts):圈圈(id1 开口
|
|
2855
|
-
* 椭圆描边)/划线(id2 直线,path height=0 → boxHeight 回退行字高 + translateY
|
|
2856
|
-
* 补半高 quirk)/背景(id4 粉色填充)/逐字三圆(id6 首子路径)/逐字手写
|
|
2857
|
-
* (id7 alignVertical=bottom)。texts 总长恒等于 text 长(fabric 守卫同款)。
|
|
2858
|
-
* 覆盖:整段行末 run(end==boxes.length 虚拟尾盒)/部分段混合/盒宽换行跨行
|
|
2859
|
-
* 切分/硬换行独立 '\n' 段/粗细重调/isSingle scale·alignVertical 档。
|
|
2860
|
-
*/
|
|
2861
|
-
export const makeTextHighlightScene = () => {
|
|
2862
|
-
const circleMark = 'M51.3646 45.8642C49.7808 46.2782 47.906 46.705 45.8588 47.0857M45.8588 47.0857C34.1649 49.2607 16.8486 49.9343 16.0277 38.1484C15.22 26.5533 32.264 22.3636 45.6135 24.5626C53.601 25.8783 57.4507 29.6208 57.9285 34.237C58.2811 37.6435 55.778 43.3702 45.8588 47.0857ZM45.8588 47.0857C42.3367 48.4051 37.8795 49.4708 32.283 50.0891';
|
|
2863
|
-
const lineMark = 'M15 36L57 36';
|
|
2864
|
-
const bgMark = 'M4,2.6C4.4,1.1,5.8,0,7.4,0h0.3v21H3.5c-2.3,0-4-2.2-3.4-4.4L4,2.6z M7.4,0H60.3v21H7.4V0z M64,18.4c-0.4,1.5-1.8,2.6-3.4,2.6h-0.3V0h4.2c2.3,0,4,2.2,3.4,4.4L64,18.4z';
|
|
2865
|
-
const dotMark = 'M35 36.5 a11 11 0 1 0 -22 0 a11 11 0 1 0 22 0 Z M48 36.5 a11 11 0 1 0 -22 0 a11 11 0 1 0 22 0 Z M59 36.5 a11 11 0 1 0 -22 0 a11 11 0 1 0 22 0 Z';
|
|
2866
|
-
const handMark = 'M26.147 47.719c.144-.04.295-.07.445-.052.282.029.529.215.811.273s.656-.14.584-.407c-.085-.302-.596-.267-.764-.54-.373-.616-1.112-.993-1.846-.993-.198 0-.396.029-.583.087a4 4 0 0 0-.613.261c-.83.407-1.714.924-2.014 1.777a2.4 2.4 0 0 0-.126.622 6.6 6.6 0 0 0 0 1.457c.132 1.11.679 2.306 1.773 2.672.349.116.728.14 1.094.116.896-.047 1.804-.337 2.441-.94.385-.367.674-.86.65-1.383-.018-.523-.415-1.04-.95-1.103-.626-.076-.638-1.11-1.239-1.295a.56.56 0 0 0-.62.22.54.54 0 0 0 .055.64c.223.243.192.632.018.91-.174.28-.457.471-.74.657-.222.151-.552.29-.733.087-.096-.104-.09-.261-.072-.4.18-1.243 1.172-2.335 2.423-2.666zm.998 3.258c.09-.21.114-.447.06-.668h.006a.8.8 0 0 0 .469-.151c-.06.4-.198.79-.39 1.144-.043.081-.187.023-.211-.064-.018-.087.03-.174.066-.261M23.375 50s.024.052.03.082c-.066.127 0 .278.012.423 0 .117-.096.244-.192.244a.13.13 0 0 1-.072-.029c-.06-.052-.048-.145-.03-.22q.08-.408.168-.825c0-.023.012-.052.024-.076.066-.098.24 0 .247.11 0 .117-.09.21-.18.291zm15.772-2.281c.144-.04.294-.07.445-.052.282.029.529.215.811.273s.656-.14.584-.407c-.085-.302-.596-.267-.764-.54-.373-.616-1.112-.993-1.846-.993a2 2 0 0 0-.583.087 4 4 0 0 0-.613.261c-.83.407-1.714.924-2.014 1.777a2.4 2.4 0 0 0-.126.622 6.6 6.6 0 0 0 0 1.457c.132 1.11.679 2.306 1.773 2.672.349.116.728.14 1.094.116.896-.047 1.804-.337 2.441-.94.385-.367.674-.86.65-1.383-.018-.523-.415-1.04-.95-1.103-.626-.076-.638-1.11-1.239-1.295a.56.56 0 0 0-.62.22.54.54 0 0 0 .055.64c.223.243.192.632.018.91-.174.28-.457.471-.74.657-.222.151-.553.29-.733.087-.096-.104-.09-.261-.072-.4.18-1.243 1.172-2.335 2.423-2.666z';
|
|
2867
|
-
const svg = (path, over = {}) => ({ type: 'svg', svgInfo: { path, stroke: '', fill: '', strokeWidth: 3, isFill: false, ...over } });
|
|
2868
|
-
const base = (over) => ({
|
|
2869
|
-
type: 'textbox',
|
|
2870
|
-
scaleX: 1,
|
|
2871
|
-
scaleY: 1,
|
|
2872
|
-
angle: 0,
|
|
2873
|
-
originX: 'left',
|
|
2874
|
-
originY: 'top',
|
|
2875
|
-
opacity: 1,
|
|
2876
|
-
strokeWidth: 0,
|
|
2877
|
-
visible: true,
|
|
2878
|
-
fontFamily: 'sans-serif',
|
|
2879
|
-
lineHeight: 1.16,
|
|
2880
|
-
textAlign: 'left',
|
|
2881
|
-
fill: 'rgba(26,26,26,0.95)',
|
|
2882
|
-
...over
|
|
2883
|
-
});
|
|
2884
|
-
return [
|
|
2885
|
-
// 划线整段(span 描边;path height=0 → boxHeight 回退 + 半高补偿 quirk;行末 run 触虚拟尾盒)
|
|
2886
|
-
{
|
|
2887
|
-
...base({ left: 80, top: 60, width: 620, text: '整段划线标记文本', fontSize: 44, texts: [{ text: '整段划线标记文本', highlight: svg(lineMark, { stroke: '#F96023', strokeWidth: 6 }) }] }),
|
|
2888
|
-
id: 'hl0'
|
|
2889
|
-
},
|
|
2890
|
-
// 圈圈部分段(前二字标记 + 其余裸段混合;圈圈 path 开口 Z 闭合)
|
|
2891
|
-
{
|
|
2892
|
-
...base({
|
|
2893
|
-
left: 820,
|
|
2894
|
-
top: 60,
|
|
2895
|
-
width: 560,
|
|
2896
|
-
text: '重点标记剩余部分',
|
|
2897
|
-
fontSize: 44,
|
|
2898
|
-
texts: [{ text: '重点标', highlight: svg(circleMark, { stroke: '#FFC300', strokeWidth: 2.5 }) }, { text: '记剩余部分' }]
|
|
2899
|
-
}),
|
|
2900
|
-
id: 'hl1'
|
|
2901
|
-
},
|
|
2902
|
-
// 背景填充 + 盒宽换行跨行切分(整段标记跨两个视觉行 → 两 run)
|
|
2903
|
-
{
|
|
2904
|
-
...base({
|
|
2905
|
-
left: 80,
|
|
2906
|
-
top: 220,
|
|
2907
|
-
width: 460,
|
|
2908
|
-
text: '背景填充高亮跨行自动换行分段渲染效果',
|
|
2909
|
-
fontSize: 40,
|
|
2910
|
-
lineHeight: 1.4,
|
|
2911
|
-
texts: [{ text: '背景填充高亮跨行自动换行分段渲染效果', highlight: svg(bgMark, { fill: 'pink', isFill: true, strokeWidth: 3 }) }]
|
|
2912
|
-
}),
|
|
2913
|
-
id: 'hl2'
|
|
2914
|
-
},
|
|
2915
|
-
// 逐字三圆 isSingle(首子路径逐字重复;scale 1.3)
|
|
2916
|
-
{
|
|
2917
|
-
...base({
|
|
2918
|
-
left: 820,
|
|
2919
|
-
top: 260,
|
|
2920
|
-
width: 560,
|
|
2921
|
-
text: 'dot mark per char',
|
|
2922
|
-
fontSize: 40,
|
|
2923
|
-
charSpacing: 40,
|
|
2924
|
-
texts: [{ text: 'dot mark per char', highlight: svg(dotMark, { fill: '#ff9cff', isFill: true, isSingle: true, scale: 1.3 }) }]
|
|
2925
|
-
}),
|
|
2926
|
-
id: 'hl3'
|
|
2927
|
-
},
|
|
2928
|
-
// 逐字手写 isSingle + alignVertical bottom + scale 0.3(拉丁跳空格字)
|
|
2929
|
-
{
|
|
2930
|
-
...base({
|
|
2931
|
-
left: 80,
|
|
2932
|
-
top: 420,
|
|
2933
|
-
width: 620,
|
|
2934
|
-
text: 'hand written below',
|
|
2935
|
-
fontSize: 44,
|
|
2936
|
-
texts: [{ text: 'hand written below', highlight: svg(handMark, { fill: '#f95555', isFill: true, isSingle: true, scale: 0.3, alignVertical: 'bottom' }) }]
|
|
2937
|
-
}),
|
|
2938
|
-
id: 'hl4'
|
|
2939
|
-
},
|
|
2940
|
-
// 硬换行独立 '\n' 段 + 两行异标(ElementMark splitTextByNewline 写入形态)
|
|
2941
|
-
{
|
|
2942
|
-
...base({
|
|
2943
|
-
left: 820,
|
|
2944
|
-
top: 420,
|
|
2945
|
-
width: 560,
|
|
2946
|
-
text: '上行划线\n下行圈圈',
|
|
2947
|
-
fontSize: 44,
|
|
2948
|
-
lineHeight: 1.4,
|
|
2949
|
-
texts: [
|
|
2950
|
-
{ text: '上行划线', highlight: svg(lineMark, { stroke: '#2060c0', strokeWidth: 8 }) },
|
|
2951
|
-
{ text: '\n' },
|
|
2952
|
-
{ text: '下行圈圈', highlight: svg(circleMark, { stroke: '#c03030', strokeWidth: 2.5 }) }
|
|
2953
|
-
]
|
|
2954
|
-
}),
|
|
2955
|
-
id: 'hl5'
|
|
2956
|
-
},
|
|
2957
|
-
// 粗细重调 + 旋转 + center 对齐(textAlign 影响行偏移 → run 左缘跟随)
|
|
2958
|
-
{
|
|
2959
|
-
...base({
|
|
2960
|
-
left: 80,
|
|
2961
|
-
top: 620,
|
|
2962
|
-
width: 620,
|
|
2963
|
-
text: '粗细重调旋转档',
|
|
2964
|
-
fontSize: 42,
|
|
2965
|
-
angle: 12,
|
|
2966
|
-
textAlign: 'center',
|
|
2967
|
-
texts: [{ text: '粗细重调旋转档', highlight: svg(lineMark, { stroke: '#746DFF', strokeWidth: 10 }) }]
|
|
2968
|
-
}),
|
|
2969
|
-
id: 'hl6'
|
|
2970
|
-
}
|
|
2971
|
-
];
|
|
2972
|
-
};
|
|
2973
|
-
/**
|
|
2974
|
-
* 弧形文本特效场景(批次 64):ArcText/CircleText + PSD 特效三族(投影/纯色
|
|
2975
|
-
* 填充/描边内外中)烘焙合成 parity(应用类沿 charTransformations 逐字绘制为
|
|
2976
|
-
* ground truth)。effects 数据形态照 makeTextFxScene(文本族 width 走 size.value、
|
|
2977
|
-
* stroke fillType 'color')。种子约定:generic 字体;无 outerGlow/gradientOverlay
|
|
2978
|
-
* (不承接族);无虚线/纹理类。
|
|
2979
|
-
*/
|
|
2980
|
-
export const makeArcTextFxScene = () => {
|
|
2981
|
-
const base = (over) => ({ scaleX: 1, scaleY: 1, angle: 0, originX: 'left', originY: 'top', opacity: 1, strokeWidth: 0, visible: true, fontFamily: 'sans-serif', lineHeight: 1.16, ...over });
|
|
2982
|
-
const shadow = (fill, blur, offsetX, offsetY) => ({ enabled: true, showInDialog: true, fill, blur, offsetX, offsetY });
|
|
2983
|
-
const solid = (fill) => ({ enabled: true, showInDialog: true, fillType: 0, fill });
|
|
2984
|
-
const stroke = (fill, value, position) => ({ enabled: true, showInDialog: true, fill, fillType: 'color', size: { value }, position });
|
|
2985
|
-
const fx = (effects) => ({
|
|
2986
|
-
stroke: [],
|
|
2987
|
-
solidFill: [],
|
|
2988
|
-
dropShadow: [],
|
|
2989
|
-
outerGlow: { enabled: true, showInDialog: true },
|
|
2990
|
-
gradientOverlay: [],
|
|
2991
|
-
...effects
|
|
2992
|
-
});
|
|
2993
|
-
return [
|
|
2994
|
-
// 弧+投影(正曲率)
|
|
2995
|
-
{
|
|
2996
|
-
...base({
|
|
2997
|
-
type: 'ArcText',
|
|
2998
|
-
left: 60,
|
|
2999
|
-
top: 40,
|
|
3000
|
-
text: '弧形投影文字',
|
|
3001
|
-
fontSize: 44,
|
|
3002
|
-
fill: 'rgba(30,90,150,0.95)',
|
|
3003
|
-
curvature: 70,
|
|
3004
|
-
effects: fx({ dropShadow: [shadow('rgba(200,40,40,0.55)', 12, 10, 8)] })
|
|
3005
|
-
}),
|
|
3006
|
-
id: 'afx0'
|
|
3007
|
-
},
|
|
3008
|
-
// 弧+外描边(负曲率下垂)
|
|
3009
|
-
{
|
|
3010
|
-
...base({ type: 'ArcText', left: 480, top: 30, text: '下垂外描边', fontSize: 44, fill: 'rgba(160,60,90,0.95)', curvature: -60, effects: fx({ stroke: [stroke('#ff6600', 6, 'outside')] }) }),
|
|
3011
|
-
id: 'afx1'
|
|
3012
|
-
},
|
|
3013
|
-
// 弧+内描边(source-atop 裁进字形域)
|
|
3014
|
-
{
|
|
3015
|
-
...base({ type: 'ArcText', left: 60, top: 250, text: '内描边弧形', fontSize: 40, fill: 'rgba(50,120,70,0.95)', curvature: 50, effects: fx({ stroke: [stroke('#20c0a0', 5, 'inside')] }) }),
|
|
3016
|
-
id: 'afx2'
|
|
3017
|
-
},
|
|
3018
|
-
// 弧+居中描边+纯色填充双层
|
|
3019
|
-
{
|
|
3020
|
-
...base({
|
|
3021
|
-
type: 'ArcText',
|
|
3022
|
-
left: 480,
|
|
3023
|
-
top: 240,
|
|
3024
|
-
text: '填充居描双层',
|
|
3025
|
-
fontSize: 40,
|
|
3026
|
-
fill: 'rgba(120,80,160,0.95)',
|
|
3027
|
-
curvature: 65,
|
|
3028
|
-
effects: fx({ solidFill: [solid('rgba(255,220,80,0.9)')], stroke: [stroke('#8040c0', 4, 'center')] })
|
|
3029
|
-
}),
|
|
3030
|
-
id: 'afx3'
|
|
3031
|
-
},
|
|
3032
|
-
// 圆形环绕+投影+外描边多层组合
|
|
3033
|
-
{
|
|
3034
|
-
...base({
|
|
3035
|
-
type: 'CircleText',
|
|
3036
|
-
left: 60,
|
|
3037
|
-
top: 450,
|
|
3038
|
-
text: '圆形环绕多层特效',
|
|
3039
|
-
fontSize: 30,
|
|
3040
|
-
fill: 'rgba(180,110,30,0.95)',
|
|
3041
|
-
circleSize: 85,
|
|
3042
|
-
circleSweep: 360,
|
|
3043
|
-
effects: fx({ dropShadow: [shadow('rgba(30,30,120,0.5)', 10, 8, 8)], stroke: [stroke('#2050ff', 4, 'outside')] })
|
|
3044
|
-
}),
|
|
3045
|
-
id: 'afx4'
|
|
3046
|
-
},
|
|
3047
|
-
// 弧+投影+外描边+填充全叠加
|
|
3048
|
-
{
|
|
3049
|
-
...base({
|
|
3050
|
-
type: 'ArcText',
|
|
3051
|
-
left: 420,
|
|
3052
|
-
top: 440,
|
|
3053
|
-
text: '全特效叠加弧形',
|
|
3054
|
-
fontSize: 36,
|
|
3055
|
-
fill: 'rgba(30,120,140,0.95)',
|
|
3056
|
-
curvature: 55,
|
|
3057
|
-
effects: fx({ dropShadow: [shadow('rgba(160,20,20,0.5)', 10, 7, 7)], solidFill: [solid('rgba(140,220,255,0.85)')], stroke: [stroke('#c02060', 4, 'outside')] })
|
|
3058
|
-
}),
|
|
3059
|
-
id: 'afx5'
|
|
3060
|
-
}
|
|
3061
|
-
];
|
|
3062
|
-
};
|
|
3063
|
-
/**
|
|
3064
|
-
* 弧形文本漏白回归场景(批次 80):用户报障同款形态——小字黑填充 + 双层外描边
|
|
3065
|
-
* (红 #e2534d 4px 内环 + 灰 #666666 8px 外环)。小字号(24)计数器窄,描边带
|
|
3066
|
-
* 淹入字形细缝——EDT 源与超采样尺度失配(rs 桶源被重采样)时细缝轮廓漂移露白,
|
|
3067
|
-
* 是漏白判别力最强的形态(大字号计数器宽,环带与字形边缘的亚像素失配不显形)。
|
|
3068
|
-
*/
|
|
3069
|
-
export const makeArcTextLeakScene = () => [
|
|
3070
|
-
{
|
|
3071
|
-
scaleX: 1,
|
|
3072
|
-
scaleY: 1,
|
|
3073
|
-
angle: 0,
|
|
3074
|
-
originX: 'left',
|
|
3075
|
-
originY: 'top',
|
|
3076
|
-
opacity: 1,
|
|
3077
|
-
strokeWidth: 0,
|
|
3078
|
-
visible: true,
|
|
3079
|
-
fontFamily: 'sans-serif',
|
|
3080
|
-
lineHeight: 1.16,
|
|
3081
|
-
type: 'ArcText',
|
|
3082
|
-
id: 'alk0',
|
|
3083
|
-
left: 60,
|
|
3084
|
-
top: 60,
|
|
3085
|
-
text: '点击编辑标题',
|
|
3086
|
-
fontSize: 24,
|
|
3087
|
-
fill: '#000000',
|
|
3088
|
-
curvature: 55,
|
|
3089
|
-
effects: {
|
|
3090
|
-
stroke: [
|
|
3091
|
-
{ enabled: true, showInDialog: true, fill: '#e2534d', fillType: 'color', size: { value: 4 }, position: 'outside' },
|
|
3092
|
-
{ enabled: true, showInDialog: true, fill: '#666666', fillType: 'color', size: { value: 8 }, position: 'outside' }
|
|
3093
|
-
],
|
|
3094
|
-
solidFill: [],
|
|
3095
|
-
dropShadow: [],
|
|
3096
|
-
outerGlow: { enabled: true, showInDialog: true },
|
|
3097
|
-
gradientOverlay: []
|
|
3098
|
-
}
|
|
3099
|
-
}
|
|
3100
|
-
];
|
|
3101
|
-
/**
|
|
3102
|
-
* 表格场景(Phase 4 P4-4):Table 的布局重算 + 摆位 quirk parity。
|
|
3103
|
-
*
|
|
3104
|
-
* 引擎与参考面(应用 Table.fromObject)都不消费序列化 objects/rowHeights——
|
|
3105
|
-
* 由 rows/cols/columnWidths/manualRowHeights/cellData 重算布局;fromObject 的
|
|
3106
|
-
* triggerLayout 会平移 left/top(构造期等列宽/空文本行高 → 重设宽高回锚),
|
|
3107
|
-
* tb1/tb2/tb6/tb7 显式覆盖 Δh/Δw/双轴/带旋转缩放的平移。
|
|
3108
|
-
* 覆盖:CJK 基线 / splitByGrapheme 换行(拉丁+CJK)/ 手动行高(含 manual <
|
|
3109
|
-
* 文本需求时回涨)/ colspan / rowspan(含 isMerged 从格跳过)/ verticalAlign×
|
|
3110
|
-
* textAlign 全档 + serif italic bold / cellSpacing + 不等列宽 + 逐格填充描边 /
|
|
3111
|
-
* 旋转缩放链 / 空文本格与 cellData 缺格。
|
|
3112
|
-
* 种子约定(已知缺口的规避带,见 roadmap):generic 字体(sans-serif/serif,
|
|
3113
|
-
* 避开 loadFontFamily 异步);单元格文本远离 collapseUnexpectedWrapIfSingleLineFits
|
|
3114
|
-
* 容差带(单行放宽 ≥20px 或溢出 ≥20px);无逐字 styles/charSpacing/表格 opacity。
|
|
3115
|
-
*/
|
|
3116
|
-
export const makeTableScene = () => {
|
|
3117
|
-
const base = (over) => ({ type: 'Table', scaleX: 1, scaleY: 1, angle: 0, originX: 'left', originY: 'top', opacity: 1, strokeWidth: 0, visible: true, ...over });
|
|
3118
|
-
// 单元格条目(真实 toObject 形态:fill/stroke/textFill/fontSize/fontFamily/textAlign
|
|
3119
|
-
// 全显式)。fontWeight/fontStyle 必写——fromObject 的 text.set 原样透传,undefined
|
|
3120
|
-
// 会抹掉 fabric 类默认 'normal' 且 fontStyle 触发即时重排(getFontCache 崩);
|
|
3121
|
-
// 生产 toObject 恒写这两键,种子须同形
|
|
3122
|
-
const cell = (row, col, over) => ({
|
|
3123
|
-
row,
|
|
3124
|
-
col,
|
|
3125
|
-
fill: '#ffffff',
|
|
3126
|
-
stroke: '#d6d6d6',
|
|
3127
|
-
text: '',
|
|
3128
|
-
textFill: '#333333',
|
|
3129
|
-
fontSize: 14,
|
|
3130
|
-
fontFamily: 'sans-serif',
|
|
3131
|
-
fontWeight: 'normal',
|
|
3132
|
-
fontStyle: 'normal',
|
|
3133
|
-
textAlign: 'center',
|
|
3134
|
-
...over
|
|
3135
|
-
});
|
|
3136
|
-
return [
|
|
3137
|
-
// 基线:等列宽 + 单行文本(w0==w1、h0==h1——摆位平移为零)
|
|
3138
|
-
{
|
|
3139
|
-
...base({
|
|
3140
|
-
left: 60,
|
|
3141
|
-
top: 50,
|
|
3142
|
-
rows: 3,
|
|
3143
|
-
cols: 3,
|
|
3144
|
-
columnWidths: [120, 120, 120],
|
|
3145
|
-
minCellHeight: 40,
|
|
3146
|
-
cellPadding: 8,
|
|
3147
|
-
cellSpacing: 0,
|
|
3148
|
-
cellStrokeWidth: 1,
|
|
3149
|
-
cellFill: '#ffffff',
|
|
3150
|
-
cellStroke: '#d0d0d0',
|
|
3151
|
-
textFill: '#333333'
|
|
3152
|
-
}),
|
|
3153
|
-
id: 'tb0',
|
|
3154
|
-
cellData: [
|
|
3155
|
-
cell(0, 0, { text: '名称' }),
|
|
3156
|
-
cell(0, 1, { text: '数量' }),
|
|
3157
|
-
cell(0, 2, { text: '单价' }),
|
|
3158
|
-
cell(1, 0, { text: '苹果' }),
|
|
3159
|
-
cell(1, 1, { text: '香蕉' }),
|
|
3160
|
-
cell(1, 2, { text: '葡萄' }),
|
|
3161
|
-
cell(2, 0, { text: '合计' }),
|
|
3162
|
-
cell(2, 1, { text: '十二' }),
|
|
3163
|
-
cell(2, 2, { text: '三十四', textFill: '#8a2b2b' })
|
|
3164
|
-
]
|
|
3165
|
-
},
|
|
3166
|
-
// splitByGrapheme 换行:拉丁逐字素断行 + CJK 撑高行(Δh 摆位平移)
|
|
3167
|
-
{
|
|
3168
|
-
...base({
|
|
3169
|
-
left: 500,
|
|
3170
|
-
top: 40,
|
|
3171
|
-
rows: 2,
|
|
3172
|
-
cols: 2,
|
|
3173
|
-
columnWidths: [130, 130],
|
|
3174
|
-
minCellHeight: 36,
|
|
3175
|
-
cellPadding: 6,
|
|
3176
|
-
cellSpacing: 0,
|
|
3177
|
-
cellStrokeWidth: 1,
|
|
3178
|
-
cellFill: '#ffffff',
|
|
3179
|
-
cellStroke: '#c8c8c8',
|
|
3180
|
-
textFill: '#333333'
|
|
3181
|
-
}),
|
|
3182
|
-
id: 'tb1',
|
|
3183
|
-
cellData: [
|
|
3184
|
-
cell(0, 0, { text: 'A rather long latin sentence to wrap', fontSize: 13, textAlign: 'left' }),
|
|
3185
|
-
cell(0, 1, { text: '春夏秋冬循环往复四季更替', fontSize: 13, textFill: '#1b4a8a' }),
|
|
3186
|
-
cell(1, 0, { text: 'short' }),
|
|
3187
|
-
cell(1, 1, { text: '短句' })
|
|
3188
|
-
]
|
|
3189
|
-
},
|
|
3190
|
-
// 手动行高:manual=64(高)/ manual=30 < 文本需求(回涨 31.82)/ null(默认);
|
|
3191
|
-
// (2,1) cellData 缺格(应用侧 = 空文本对象参与行高,引擎 emptyCellHeight 同义)
|
|
3192
|
-
{
|
|
3193
|
-
...base({
|
|
3194
|
-
left: 880,
|
|
3195
|
-
top: 50,
|
|
3196
|
-
rows: 3,
|
|
3197
|
-
cols: 2,
|
|
3198
|
-
columnWidths: [110, 110],
|
|
3199
|
-
manualRowHeights: [64, 30, null],
|
|
3200
|
-
minCellHeight: 40,
|
|
3201
|
-
cellPadding: 8,
|
|
3202
|
-
cellSpacing: 0,
|
|
3203
|
-
cellStrokeWidth: 1,
|
|
3204
|
-
cellFill: '#ffffff',
|
|
3205
|
-
cellStroke: '#d0d0d0',
|
|
3206
|
-
textFill: '#333333'
|
|
3207
|
-
}),
|
|
3208
|
-
id: 'tb2',
|
|
3209
|
-
cellData: [cell(0, 0, { text: '高行' }), cell(0, 1, { text: '手动' }), cell(1, 0, { text: '回涨', fontSize: 14 }), cell(1, 1, { text: '行' }), cell(2, 0, { text: '常规' })]
|
|
3210
|
-
},
|
|
3211
|
-
// colspan=2 表头(跨列文本盒 = 合并列宽 − 2×padding)+ 空文本格
|
|
3212
|
-
{
|
|
3213
|
-
...base({
|
|
3214
|
-
left: 60,
|
|
3215
|
-
top: 300,
|
|
3216
|
-
rows: 2,
|
|
3217
|
-
cols: 3,
|
|
3218
|
-
columnWidths: [100, 100, 100],
|
|
3219
|
-
minCellHeight: 40,
|
|
3220
|
-
cellPadding: 8,
|
|
3221
|
-
cellSpacing: 0,
|
|
3222
|
-
cellStrokeWidth: 1,
|
|
3223
|
-
cellFill: '#ffffff',
|
|
3224
|
-
cellStroke: '#d0d0d0',
|
|
3225
|
-
textFill: '#333333'
|
|
3226
|
-
}),
|
|
3227
|
-
id: 'tb3',
|
|
3228
|
-
cellData: [
|
|
3229
|
-
cell(0, 0, { text: '跨两列的表头', colspan: 2, fontSize: 15, fontWeight: 'bold', fill: '#f2f2f2' }),
|
|
3230
|
-
cell(0, 2, { text: '备注' }),
|
|
3231
|
-
cell(1, 0, { text: '甲' }),
|
|
3232
|
-
cell(1, 1, {}),
|
|
3233
|
-
cell(1, 2, { text: '丙' })
|
|
3234
|
-
]
|
|
3235
|
-
},
|
|
3236
|
-
// rowspan=2 纵向合并((1,0) 为 isMerged 从格——引擎不合成、参考面 opacity 0)
|
|
3237
|
-
{
|
|
3238
|
-
...base({
|
|
3239
|
-
left: 500,
|
|
3240
|
-
top: 300,
|
|
3241
|
-
rows: 3,
|
|
3242
|
-
cols: 2,
|
|
3243
|
-
columnWidths: [110, 110],
|
|
3244
|
-
minCellHeight: 40,
|
|
3245
|
-
cellPadding: 8,
|
|
3246
|
-
cellSpacing: 0,
|
|
3247
|
-
cellStrokeWidth: 1,
|
|
3248
|
-
cellFill: '#ffffff',
|
|
3249
|
-
cellStroke: '#d0d0d0',
|
|
3250
|
-
textFill: '#333333'
|
|
3251
|
-
}),
|
|
3252
|
-
id: 'tb4',
|
|
3253
|
-
cellData: [
|
|
3254
|
-
cell(0, 0, { text: '跨两行内容', rowspan: 2, fill: '#eef7ee', stroke: '#6ba36b' }),
|
|
3255
|
-
cell(0, 1, { text: '右上' }),
|
|
3256
|
-
cell(1, 0, { isMerged: true, mergeParent: { row: 0, col: 0 } }),
|
|
3257
|
-
cell(1, 1, { text: '右中' }),
|
|
3258
|
-
cell(2, 0, { text: '左下' }),
|
|
3259
|
-
cell(2, 1, { text: '右下' })
|
|
3260
|
-
]
|
|
3261
|
-
},
|
|
3262
|
-
// verticalAlign(top/middle/bottom)× textAlign(left/center/right)全档 +
|
|
3263
|
-
// serif italic bold 字体变体(行高 64 使对齐差异可见)
|
|
3264
|
-
{
|
|
3265
|
-
...base({
|
|
3266
|
-
left: 820,
|
|
3267
|
-
top: 300,
|
|
3268
|
-
rows: 3,
|
|
3269
|
-
cols: 2,
|
|
3270
|
-
columnWidths: [130, 130],
|
|
3271
|
-
minCellHeight: 64,
|
|
3272
|
-
cellPadding: 8,
|
|
3273
|
-
cellSpacing: 0,
|
|
3274
|
-
cellStrokeWidth: 1,
|
|
3275
|
-
cellFill: '#ffffff',
|
|
3276
|
-
cellStroke: '#d0d0d0',
|
|
3277
|
-
textFill: '#333333'
|
|
3278
|
-
}),
|
|
3279
|
-
id: 'tb5',
|
|
3280
|
-
cellData: [
|
|
3281
|
-
cell(0, 0, { text: '顶部居左', verticalAlign: 'top', textAlign: 'left' }),
|
|
3282
|
-
cell(0, 1, { text: '底部居右', verticalAlign: 'bottom', textAlign: 'right', fontFamily: 'serif', fontStyle: 'italic', fontWeight: 'bold', textFill: '#6a3fa0' }),
|
|
3283
|
-
cell(1, 0, { text: '垂直居中' }),
|
|
3284
|
-
cell(1, 1, { text: '顶部居右', verticalAlign: 'top', textAlign: 'right', fontWeight: 'bold' }),
|
|
3285
|
-
cell(2, 0, { text: '底部居左', verticalAlign: 'bottom', textAlign: 'left', textFill: '#1b4a8a' }),
|
|
3286
|
-
cell(2, 1, { text: '默认档' })
|
|
3287
|
-
]
|
|
3288
|
-
},
|
|
3289
|
-
// cellSpacing=2 + 不等列宽(Δw=−45 强摆位平移)+ 逐格填充描边(视觉左移到 ~15)
|
|
3290
|
-
{
|
|
3291
|
-
...base({
|
|
3292
|
-
left: 60,
|
|
3293
|
-
top: 560,
|
|
3294
|
-
rows: 2,
|
|
3295
|
-
cols: 3,
|
|
3296
|
-
columnWidths: [90, 150, 120],
|
|
3297
|
-
minCellHeight: 40,
|
|
3298
|
-
cellPadding: 8,
|
|
3299
|
-
cellSpacing: 2,
|
|
3300
|
-
cellStrokeWidth: 1,
|
|
3301
|
-
cellFill: '#ffffff',
|
|
3302
|
-
cellStroke: '#d6d6d6',
|
|
3303
|
-
textFill: '#333333'
|
|
3304
|
-
}),
|
|
3305
|
-
id: 'tb6',
|
|
3306
|
-
cellData: [
|
|
3307
|
-
cell(0, 0, { text: '甲', fill: '#e8f0fe', stroke: '#5b7fb9' }),
|
|
3308
|
-
cell(0, 1, { text: '宽列内容', fill: '#fdf0e8', stroke: '#b97a5b', textAlign: 'left' }),
|
|
3309
|
-
cell(0, 2, { text: '丙' }),
|
|
3310
|
-
cell(1, 0, { text: '丁', fill: '#eef7ee', stroke: '#6ba36b' }),
|
|
3311
|
-
cell(1, 1, { text: '戊' }),
|
|
3312
|
-
cell(1, 2, { text: '己' })
|
|
3313
|
-
]
|
|
3314
|
-
},
|
|
3315
|
-
// 旋转 + 缩放链(摆位平移随 angle 旋转、随 scale 缩放——mat2d 中心换算复刻)
|
|
3316
|
-
{
|
|
3317
|
-
...base({
|
|
3318
|
-
left: 900,
|
|
3319
|
-
top: 540,
|
|
3320
|
-
rows: 2,
|
|
3321
|
-
cols: 2,
|
|
3322
|
-
columnWidths: [120, 100],
|
|
3323
|
-
minCellHeight: 40,
|
|
3324
|
-
cellPadding: 8,
|
|
3325
|
-
cellSpacing: 1,
|
|
3326
|
-
cellStrokeWidth: 1,
|
|
3327
|
-
cellFill: '#ffffff',
|
|
3328
|
-
cellStroke: '#c0c0c0',
|
|
3329
|
-
textFill: '#333333',
|
|
3330
|
-
angle: 12,
|
|
3331
|
-
scaleX: 1.1,
|
|
3332
|
-
scaleY: 0.92
|
|
3333
|
-
}),
|
|
3334
|
-
id: 'tb7',
|
|
3335
|
-
cellData: [cell(0, 0, { text: '旋转表格' }), cell(0, 1, { text: '缩放', fill: '#fff7e8', stroke: '#c0a060' }), cell(1, 0, { text: '第二行' }), cell(1, 1, { text: '末格' })]
|
|
3336
|
-
}
|
|
3337
|
-
];
|
|
3338
|
-
};
|
|
3339
|
-
/**
|
|
3340
|
-
* 拼图/蒙版场景(P4-5b(2/2)):FabricPuzzle(Group + Mask 子对象 + layoutConfig)
|
|
3341
|
-
* 与顶层独立 Mask。覆盖:
|
|
3342
|
-
* - pz0 2×2 基线(四块全填充、cornerRadius 圆角)
|
|
3343
|
-
* - pz1 不规则布局(colSpan 跨列 + 空块——无 clipImage 直出形状位图)+ 双向
|
|
3344
|
-
* gap + groupPadding
|
|
3345
|
-
* - pz2 clipImage 变换链(angle/flip/clipX/clipY 偏移 + 用户缩放因子)
|
|
3346
|
-
* - pz3 组旋转 25° + 缩放 1.15 + 半透明(隔离合成口径)
|
|
3347
|
-
* - pz4 结构不完整(pieces 3 vs 实有 2 mask)→ 两侧自动收拢成 2 块(裁尾
|
|
3348
|
-
* 重算 cols=2)再重排(应用 updateLayout / 引擎 relayoutFromConfig 同公式),
|
|
3349
|
-
* authored 几何刻意写错以证明重排
|
|
3350
|
-
* - pz5 顶层独立 Mask(非拼图内)
|
|
3351
|
-
* 遮罩形状源与填充图共用本地素材(不透明位图 → destination-in 为恒等 alpha,
|
|
3352
|
-
* 圆角由烘焙 clip 提供);mask 序列化形态对齐生产 toObject(origin center、
|
|
3353
|
-
* 恒写 width/height/cropX/cropY、clipImage 为完整序列化 image 对象)。
|
|
3354
|
-
*/
|
|
3355
|
-
export const makePuzzleScene = () => {
|
|
3356
|
-
const shapeSrc = assetUrl('../../assets/images/nasty_fabric.png'); // 198×200(不透明)
|
|
3357
|
-
const woodSrc = assetUrl('../../assets/images/retina_wood.png'); // 512×512
|
|
3358
|
-
const floralSrc = assetUrl('../../assets/images/greyfloral.png'); // 150×124
|
|
3359
|
-
const rotateSrc = assetUrl('../../assets/images/rotate.png'); // 200×200
|
|
3360
|
-
const honeySrc = assetUrl('../../assets/images/honey_im_subtle.png'); // 179×132
|
|
3361
|
-
/** mask 序列化子对象(cover 初始比例由图片 natural 与块尺寸推出——生产链路
|
|
3362
|
-
* useHandleCreate 的 cover 填充同公式) */
|
|
3363
|
-
const clip = (src, natW, natH, w, h, extra = {}) => ({
|
|
3364
|
-
type: 'image',
|
|
3365
|
-
src,
|
|
3366
|
-
left: 0,
|
|
3367
|
-
top: 0,
|
|
3368
|
-
width: natW,
|
|
3369
|
-
height: natH,
|
|
3370
|
-
scaleX: Math.max(w / natW, h / natH),
|
|
3371
|
-
scaleY: Math.max(w / natW, h / natH),
|
|
3372
|
-
angle: 0,
|
|
3373
|
-
flipX: false,
|
|
3374
|
-
flipY: false,
|
|
3375
|
-
opacity: 1,
|
|
3376
|
-
originX: 'left',
|
|
3377
|
-
originY: 'top',
|
|
3378
|
-
crossOrigin: 'anonymous',
|
|
3379
|
-
cropX: 0,
|
|
3380
|
-
cropY: 0,
|
|
3381
|
-
strokeWidth: 0,
|
|
3382
|
-
visible: true,
|
|
3383
|
-
...extra
|
|
3384
|
-
});
|
|
3385
|
-
/** clipImage 带滤镜的 mask 种子(B1(余) 收尾片):属性赋值路线避开字面量 excess check */
|
|
3386
|
-
const maskClipWithFilters = (id, left, top, w, h, cornerRadius, clipObj, filters) => {
|
|
3387
|
-
;
|
|
3388
|
-
clipObj.filters = filters;
|
|
3389
|
-
return mask(id, left, top, w, h, cornerRadius, clipObj);
|
|
3390
|
-
};
|
|
3391
|
-
const mask = (id, left, top, w, h, cornerRadius, clipImage, extra = {}) => ({
|
|
3392
|
-
type: 'Mask',
|
|
3393
|
-
id,
|
|
3394
|
-
left,
|
|
3395
|
-
top,
|
|
3396
|
-
width: w,
|
|
3397
|
-
height: h,
|
|
3398
|
-
originX: 'center',
|
|
3399
|
-
originY: 'center',
|
|
3400
|
-
scaleX: 1,
|
|
3401
|
-
scaleY: 1,
|
|
3402
|
-
angle: 0,
|
|
3403
|
-
flipX: false,
|
|
3404
|
-
flipY: false,
|
|
3405
|
-
opacity: 1,
|
|
3406
|
-
strokeWidth: 0,
|
|
3407
|
-
visible: true,
|
|
3408
|
-
src: shapeSrc,
|
|
3409
|
-
crossOrigin: 'anonymous',
|
|
3410
|
-
cropX: 0,
|
|
3411
|
-
cropY: 0,
|
|
3412
|
-
cornerRadius,
|
|
3413
|
-
innerRadius: 12,
|
|
3414
|
-
outerRadius: 0,
|
|
3415
|
-
seamlessMode: false,
|
|
3416
|
-
seamlessNess: 0,
|
|
3417
|
-
clipX: 0,
|
|
3418
|
-
clipY: 0,
|
|
3419
|
-
...(clipImage ? { clipImage } : {}),
|
|
3420
|
-
...extra
|
|
3421
|
-
});
|
|
3422
|
-
const puzzle = (id, left, top, layout, masks, params, extra = {}) => ({
|
|
3423
|
-
type: 'Puzzle',
|
|
3424
|
-
id,
|
|
3425
|
-
left,
|
|
3426
|
-
top,
|
|
3427
|
-
originX: 'center',
|
|
3428
|
-
originY: 'center',
|
|
3429
|
-
scaleX: 1,
|
|
3430
|
-
scaleY: 1,
|
|
3431
|
-
angle: 0,
|
|
3432
|
-
flipX: false,
|
|
3433
|
-
flipY: false,
|
|
3434
|
-
opacity: 1,
|
|
3435
|
-
strokeWidth: 0,
|
|
3436
|
-
visible: true,
|
|
3437
|
-
subTargetCheck: true,
|
|
3438
|
-
interactive: false,
|
|
3439
|
-
...params,
|
|
3440
|
-
layoutConfig: layout,
|
|
3441
|
-
objects: masks,
|
|
3442
|
-
...extra
|
|
3443
|
-
});
|
|
3444
|
-
// pz0:300×300、gap10 → cell 145、step155、中心 ±77.5
|
|
3445
|
-
// pz1:340×220、padding6 → inner 328×208;cols3/rows2、hGap8/vGap14 → cell 104×97、step112/111
|
|
3446
|
-
// pz2:300×140、gap10 → cell 145×140、step155
|
|
3447
|
-
// pz3:260×260、rows2/cols1、gap10 → cell 260×125、step135
|
|
3448
|
-
// pz4:300×150、cols3 只做 2 块 → 自动收拢 cols=2:cell 144、step156、中心 ±78
|
|
3449
|
-
//(authored 几何故意错——收拢重排覆盖)
|
|
3450
|
-
return [
|
|
3451
|
-
puzzle('pz0', 185, 175, {
|
|
3452
|
-
rows: 2,
|
|
3453
|
-
cols: 2,
|
|
3454
|
-
pieces: [
|
|
3455
|
-
{ id: 1, row: 0, col: 0 },
|
|
3456
|
-
{ id: 2, row: 0, col: 1 },
|
|
3457
|
-
{ id: 3, row: 1, col: 0 },
|
|
3458
|
-
{ id: 4, row: 1, col: 1 }
|
|
3459
|
-
]
|
|
3460
|
-
}, [
|
|
3461
|
-
mask('pz0_m0', -77.5, -77.5, 145, 145, 12, clip(woodSrc, 512, 512, 145, 145)),
|
|
3462
|
-
mask('pz0_m1', 77.5, -77.5, 145, 145, 12, clip(floralSrc, 150, 124, 145, 145)),
|
|
3463
|
-
mask('pz0_m2', -77.5, 77.5, 145, 145, 12, clip(rotateSrc, 200, 200, 145, 145)),
|
|
3464
|
-
mask('pz0_m3', 77.5, 77.5, 145, 145, 12, clip(shapeSrc, 198, 200, 145, 145))
|
|
3465
|
-
], { layoutWidth: 300, layoutHeight: 300, hGap: 10, vGap: 10, groupPadding: 0, cornerRadius: 12 }),
|
|
3466
|
-
puzzle('pz1', 600, 175, {
|
|
3467
|
-
rows: 2,
|
|
3468
|
-
cols: 3,
|
|
3469
|
-
pieces: [
|
|
3470
|
-
{ id: 1, row: 0, col: 0, colSpan: 2 },
|
|
3471
|
-
{ id: 2, row: 0, col: 2 },
|
|
3472
|
-
{ id: 3, row: 1, col: 0 },
|
|
3473
|
-
{ id: 4, row: 1, col: 1, colSpan: 2 }
|
|
3474
|
-
]
|
|
3475
|
-
}, [
|
|
3476
|
-
mask('pz1_m0', -56, -55.5, 216, 97, 10, clip(woodSrc, 512, 512, 216, 97)),
|
|
3477
|
-
// 空块:无 clipImage → 形状位图直出(应用 super.render 同构)
|
|
3478
|
-
mask('pz1_m1', 112, -55.5, 104, 97, 10, null),
|
|
3479
|
-
// col0 单格中心 = (0−1)×112 = −112(列基准 (cols−1)/2 = 1——首版误写 −56
|
|
3480
|
-
// 与 m3 重叠 48px,种子自检测试锁定;见 puzzleLayout.spec「种子几何=公式」)
|
|
3481
|
-
mask('pz1_m2', -112, 55.5, 104, 97, 10, clip(honeySrc, 179, 132, 104, 97)),
|
|
3482
|
-
mask('pz1_m3', 56, 55.5, 216, 97, 10, clip(floralSrc, 150, 124, 216, 97))
|
|
3483
|
-
], { layoutWidth: 340, layoutHeight: 220, hGap: 8, vGap: 14, groupPadding: 6, cornerRadius: 10 }),
|
|
3484
|
-
puzzle('pz2', 990, 175, {
|
|
3485
|
-
rows: 1,
|
|
3486
|
-
cols: 2,
|
|
3487
|
-
pieces: [
|
|
3488
|
-
{ id: 1, row: 0, col: 0 },
|
|
3489
|
-
{ id: 2, row: 0, col: 1 }
|
|
3490
|
-
]
|
|
3491
|
-
}, [
|
|
3492
|
-
// clipImage 变换链:angle20 + flipX + 用户缩放 1.25×cover + clipX/Y 偏移
|
|
3493
|
-
mask('pz2_m0', -77.5, 0, 145, 140, 18, clip(rotateSrc, 200, 200, 145, 140, { angle: 20, flipX: true, scaleX: Math.max(145 / 200, 140 / 200) * 1.25, scaleY: Math.max(145 / 200, 140 / 200) * 1.25 }), { clipX: 12, clipY: -8 }),
|
|
3494
|
-
mask('pz2_m1', 77.5, 0, 145, 140, 18, clip(woodSrc, 512, 512, 145, 140, { angle: -30, clipX: -15, clipY: 10 }))
|
|
3495
|
-
], { layoutWidth: 300, layoutHeight: 140, hGap: 10, vGap: 10, groupPadding: 0, cornerRadius: 18 }),
|
|
3496
|
-
puzzle('pz3', 215, 510, {
|
|
3497
|
-
rows: 2,
|
|
3498
|
-
cols: 1,
|
|
3499
|
-
pieces: [
|
|
3500
|
-
{ id: 1, row: 0, col: 0 },
|
|
3501
|
-
{ id: 2, row: 1, col: 0 }
|
|
3502
|
-
]
|
|
3503
|
-
}, [mask('pz3_m0', 0, -67.5, 260, 125, 14, clip(shapeSrc, 198, 200, 260, 125)), mask('pz3_m1', 0, 67.5, 260, 125, 14, clip(honeySrc, 179, 132, 260, 125))], { layoutWidth: 260, layoutHeight: 260, hGap: 10, vGap: 10, groupPadding: 0, cornerRadius: 14 }, { angle: 25, scaleX: 1.15, scaleY: 1.15, opacity: 0.85 }),
|
|
3504
|
-
puzzle('pz4', 600, 520, {
|
|
3505
|
-
rows: 1,
|
|
3506
|
-
cols: 3,
|
|
3507
|
-
pieces: [
|
|
3508
|
-
{ id: 1, row: 0, col: 0 },
|
|
3509
|
-
{ id: 2, row: 0, col: 1 },
|
|
3510
|
-
{ id: 3, row: 0, col: 2 }
|
|
3511
|
-
]
|
|
3512
|
-
},
|
|
3513
|
-
// authored 几何/clip 比例故意偏离——自动收拢 cols=2 后两侧重排须覆盖为 cell 144/step 156
|
|
3514
|
-
[mask('pz4_m0', -50, 20, 60, 40, 8, clip(rotateSrc, 200, 200, 60, 40, { scaleX: 0.5, scaleY: 0.5 })), mask('pz4_m1', 90, -10, 70, 50, 8, clip(floralSrc, 150, 124, 70, 50))], { layoutWidth: 300, layoutHeight: 150, hGap: 12, vGap: 12, groupPadding: 0, cornerRadius: 8 }),
|
|
3515
|
-
// 顶层独立 Mask(非拼图内):clipImage angle10 + flipY + cover
|
|
3516
|
-
mask('pz5', 990, 520, 200, 150, 20, clip(floralSrc, 150, 124, 200, 150, { angle: 10, flipY: true })),
|
|
3517
|
-
// B1(余) Mask PSD effects:pz6 = 合成层(clipImage)+ 投影/纯色填充/双层描边
|
|
3518
|
-
// 全链(drawShadows 垫底 → 合成 → drawFills → drawStrokes 倒序外圈在底)
|
|
3519
|
-
{
|
|
3520
|
-
...mask('pz6', 820, 360, 200, 140, 16, clip(woodSrc, 512, 512, 200, 140)),
|
|
3521
|
-
effects: {
|
|
3522
|
-
dropShadow: [{ enabled: true, showInDialog: true, fill: 'rgba(40,40,60,0.45)', blur: 10, offsetX: 8, offsetY: 8 }],
|
|
3523
|
-
solidFill: [{ enabled: true, showInDialog: true, fillType: 0, fill: 'rgba(70,130,180,0.55)' }],
|
|
3524
|
-
stroke: [
|
|
3525
|
-
{ enabled: true, showInDialog: true, fill: 'rgba(200,60,60,1)', strokeWidth: 5, strokeAlignment: 'outside' },
|
|
3526
|
-
{ enabled: true, showInDialog: true, fill: 'rgba(60,60,200,1)', strokeWidth: 12, strokeAlignment: 'outside' }
|
|
3527
|
-
]
|
|
3528
|
-
}
|
|
3529
|
-
},
|
|
3530
|
-
// pz7 = 直出形状 + 投影 + center 描边(直出分支的 effects 同链)
|
|
3531
|
-
{
|
|
3532
|
-
...mask('pz7', 1060, 360, 180, 130, 14, null),
|
|
3533
|
-
effects: {
|
|
3534
|
-
dropShadow: [{ enabled: true, showInDialog: true, fill: 'rgba(60,30,30,0.4)', blur: 8, offsetX: -10, offsetY: 6 }],
|
|
3535
|
-
stroke: [{ enabled: true, showInDialog: true, fill: 'rgba(30,120,60,1)', strokeWidth: 6, strokeAlignment: 'center' }]
|
|
3536
|
-
}
|
|
3537
|
-
},
|
|
3538
|
-
// B1(余) 收尾片:Mask clipImage 滤镜——pz8 fabric 口径 Grayscale、pz8b PSD
|
|
3539
|
-
// 口径 Brightness(psd:1 量纲 /100)——双序列化形态覆盖;滤镜先跑全图、
|
|
3540
|
-
// 蒙版合成后置(与 fabric「clipImage._element 滤镜输出 → ensureClipImageCache」同链)。
|
|
3541
|
-
// clip 图取不透明素材(rotate.png 透明带宽——像素探针落点不稳)
|
|
3542
|
-
maskClipWithFilters('pz8', 820, 530, 200, 140, 16, clip(woodSrc, 512, 512, 200, 140), [{ type: 'Grayscale' }]),
|
|
3543
|
-
maskClipWithFilters('pz8b', 1060, 530, 180, 130, 12, clip(honeySrc, 179, 132, 180, 130), [{ type: 'Brightness', psd: 1, brightness: 30 }])
|
|
3544
|
-
];
|
|
3545
|
-
};
|
|
3546
|
-
/**
|
|
3547
|
-
* 吸附场景(P5-2):手动验证拖拽磁吸与辅助线(snapGuide 已默认开;关=?snapGuide=0)。
|
|
3548
|
-
* 布局设计:上排 A/B 留出 120px 水平间距(拖 T 进中间触发 center/side 间距吸附);
|
|
3549
|
-
* A 自身提供点对齐(左缘/中心/顶缘);旋转/文本/组参考覆盖常见候选族;
|
|
3550
|
-
* T 为拖拽目标(拖到 A 左侧 ±8px 内磁吸贴齐、拖进 A-B 中间触发等距)。
|
|
3551
|
-
*/
|
|
3552
|
-
/**
|
|
3553
|
-
* 蒙版裁剪会话场景(B3 余量):顶层 Mask ×2(会话进入条件 = 顶层 + 静态 clip)。
|
|
3554
|
-
* - mcp0 基线:240×180 圆角 12,clip=wood 512×512 显式 scale 0.7(源 358×358 →
|
|
3555
|
-
* crop 活动域 [0,118]×[0,89]——coverage 钳制两侧都可达,e2e 两向拖拽断言用)
|
|
3556
|
-
* - mcp1 变换链:200×150 angle 12 + mask scale 1.15,clip=rotate 200×200
|
|
3557
|
-
* 显式 scale 1.4(源 280×280 → crop 域 [0,80]×[0,65])——旋转/缩放下
|
|
3558
|
-
* 拖图方向反解与手柄锚定的回归面
|
|
3559
|
-
* clip 显式 scale 覆盖 cover 缺省(makePuzzleScene 的 clip 同款 extra 机制)。
|
|
3560
|
-
*/
|
|
3561
|
-
export const makeMaskCropScene = () => {
|
|
3562
|
-
const shapeSrc = assetUrl('../../assets/images/nasty_fabric.png'); // 198×200(不透明)
|
|
3563
|
-
const woodSrc = assetUrl('../../assets/images/retina_wood.png'); // 512×512
|
|
3564
|
-
const rotateSrc = assetUrl('../../assets/images/rotate.png'); // 200×200
|
|
3565
|
-
const clip = (src, natW, natH, w, h, extra = {}) => ({
|
|
3566
|
-
type: 'image',
|
|
3567
|
-
src,
|
|
3568
|
-
left: 0,
|
|
3569
|
-
top: 0,
|
|
3570
|
-
width: natW,
|
|
3571
|
-
height: natH,
|
|
3572
|
-
scaleX: Math.max(w / natW, h / natH),
|
|
3573
|
-
scaleY: Math.max(w / natW, h / natH),
|
|
3574
|
-
angle: 0,
|
|
3575
|
-
flipX: false,
|
|
3576
|
-
flipY: false,
|
|
3577
|
-
opacity: 1,
|
|
3578
|
-
originX: 'left',
|
|
3579
|
-
originY: 'top',
|
|
3580
|
-
crossOrigin: 'anonymous',
|
|
3581
|
-
cropX: 0,
|
|
3582
|
-
cropY: 0,
|
|
3583
|
-
strokeWidth: 0,
|
|
3584
|
-
visible: true,
|
|
3585
|
-
...extra
|
|
3586
|
-
});
|
|
3587
|
-
const mask = (id, left, top, w, h, cornerRadius, clipImage, extra = {}) => ({
|
|
3588
|
-
type: 'Mask',
|
|
3589
|
-
id,
|
|
3590
|
-
left,
|
|
3591
|
-
top,
|
|
3592
|
-
width: w,
|
|
3593
|
-
height: h,
|
|
3594
|
-
originX: 'center',
|
|
3595
|
-
originY: 'center',
|
|
3596
|
-
scaleX: 1,
|
|
3597
|
-
scaleY: 1,
|
|
3598
|
-
angle: 0,
|
|
3599
|
-
flipX: false,
|
|
3600
|
-
flipY: false,
|
|
3601
|
-
opacity: 1,
|
|
3602
|
-
strokeWidth: 0,
|
|
3603
|
-
visible: true,
|
|
3604
|
-
src: shapeSrc,
|
|
3605
|
-
crossOrigin: 'anonymous',
|
|
3606
|
-
cropX: 0,
|
|
3607
|
-
cropY: 0,
|
|
3608
|
-
cornerRadius,
|
|
3609
|
-
innerRadius: 12,
|
|
3610
|
-
outerRadius: 0,
|
|
3611
|
-
seamlessMode: false,
|
|
3612
|
-
seamlessNess: 0,
|
|
3613
|
-
clipX: 0,
|
|
3614
|
-
clipY: 0,
|
|
3615
|
-
clipImage,
|
|
3616
|
-
...extra
|
|
3617
|
-
});
|
|
3618
|
-
return [
|
|
3619
|
-
mask('mcp0', 170, 110, 240, 180, 12, clip(woodSrc, 512, 512, 240, 180, { scaleX: 0.7, scaleY: 0.7 })),
|
|
3620
|
-
mask('mcp1', 600, 150, 200, 150, 0, clip(rotateSrc, 200, 200, 200, 150, { scaleX: 1.4, scaleY: 1.4 }), { angle: 12, scaleX: 1.15, scaleY: 1.15 })
|
|
3621
|
-
];
|
|
3622
|
-
};
|
|
3623
|
-
/**
|
|
3624
|
-
* 动态 clipImage 蒙版场景(B1(余) 收尾片·贰):视频/GIF 填充蒙版——
|
|
3625
|
-
* renderClipImageDirectly 语义的引擎面。gifSrc/videoSrc 由调用方生成
|
|
3626
|
-
* (dev 页 makeGifBlobUrl 五帧纯色 64×64@100ms / makeVideoBlobUrl 色相循环),
|
|
3627
|
-
* 帧内容确定可做像素探针(帧色切换 = 动画真实推进;角外 = 圆角+形状裁剪)。
|
|
3628
|
-
* gif 帧 100ms/帧 × 5 = 500ms 循环;视频 320×568 色相 4s/圈。
|
|
3629
|
-
*/
|
|
3630
|
-
export const makeDynamicMaskScene = (gifSrc, videoSrc) => {
|
|
3631
|
-
const shapeSrc = assetUrl('../../assets/images/nasty_fabric.png'); // 198×200(不透明——形状恒等,圆角是唯一裁剪特征)
|
|
3632
|
-
const mask = (id, left, top, w, h, cornerRadius, clip) => ({
|
|
3633
|
-
type: 'Mask',
|
|
3634
|
-
id,
|
|
3635
|
-
left,
|
|
3636
|
-
top,
|
|
3637
|
-
width: w,
|
|
3638
|
-
height: h,
|
|
3639
|
-
originX: 'center',
|
|
3640
|
-
originY: 'center',
|
|
3641
|
-
scaleX: 1,
|
|
3642
|
-
scaleY: 1,
|
|
3643
|
-
angle: 0,
|
|
3644
|
-
flipX: false,
|
|
3645
|
-
flipY: false,
|
|
3646
|
-
opacity: 1,
|
|
3647
|
-
strokeWidth: 0,
|
|
3648
|
-
visible: true,
|
|
3649
|
-
src: shapeSrc,
|
|
3650
|
-
crossOrigin: 'anonymous',
|
|
3651
|
-
cropX: 0,
|
|
3652
|
-
cropY: 0,
|
|
3653
|
-
cornerRadius,
|
|
3654
|
-
clipX: 0,
|
|
3655
|
-
clipY: 0,
|
|
3656
|
-
// src/type 由各块的 clip 显式给(基座不含——首版基座写死 src: gifSrc,
|
|
3657
|
-
// 视频块漏覆写 src,GIF 的 blob 被当视频加载恒 code 4,排障绕了大弯)
|
|
3658
|
-
clipImage: { left: 0, top: 0, originX: 'left', originY: 'top', crossOrigin: 'anonymous', ...clip }
|
|
3659
|
-
});
|
|
3660
|
-
// GIF 蒙版:240×180、cover(64→240/180 取 3.75)、圆角 28——帧色逐帧切换
|
|
3661
|
-
// 视频蒙版:260×200、cover(CDN 368×244 → max(260/368, 200/244)=0.8197)、loop
|
|
3662
|
-
return [
|
|
3663
|
-
mask('dm-gif', 200, 200, 240, 180, 28, { type: 'GIF', src: gifSrc, width: 64, height: 64, scaleX: 3.75, scaleY: 3.75 }),
|
|
3664
|
-
mask('dm-video', 620, 200, 260, 200, 28, { type: 'Video', src: videoSrc, width: 368, height: 244, scaleX: 0.8197, scaleY: 0.8197, loop: true })
|
|
3665
|
-
];
|
|
3666
|
-
};
|
|
3667
|
-
export const makeSnapScene = () => {
|
|
3668
|
-
const node = (over) => ({ scaleX: 1, scaleY: 1, angle: 0, originX: 'left', originY: 'top', opacity: 1, strokeWidth: 0, visible: true, ...over });
|
|
3669
|
-
return [
|
|
3670
|
-
node({ type: 'rect', id: 'snA', left: 100, top: 100, width: 120, height: 80, fill: 'rgba(154,165,177,0.95)' }),
|
|
3671
|
-
node({ type: 'rect', id: 'snB', left: 340, top: 100, width: 120, height: 80, fill: 'rgba(154,165,177,0.95)' }),
|
|
3672
|
-
node({ type: 'rect', id: 'snRot', left: 560, top: 300, width: 140, height: 90, angle: 30, fill: 'rgba(240,180,90,0.95)' }),
|
|
3673
|
-
node({ type: 'textbox', id: 'snTxt', left: 160, top: 320, width: 240, text: '吸附参考文本', fontFamily: 'sans-serif', fontSize: 36, fill: 'rgba(50,50,80,0.95)', lineHeight: 1.16 }),
|
|
3674
|
-
{
|
|
3675
|
-
...node({ type: 'Group', id: 'snGrp', left: 480, top: 480, width: 200, height: 120, angle: -8 }),
|
|
3676
|
-
objects: [
|
|
3677
|
-
node({ type: 'rect', left: -100, top: -60, width: 100, height: 120, fill: 'rgba(110,170,210,0.95)' }),
|
|
3678
|
-
node({ type: 'rect', left: 0, top: -60, width: 100, height: 120, fill: 'rgba(210,140,190,0.95)' })
|
|
3679
|
-
]
|
|
3680
|
-
},
|
|
3681
|
-
node({ type: 'rect', id: 'snT', left: 700, top: 100, width: 100, height: 60, fill: 'rgba(47,111,237,0.95)' })
|
|
3682
|
-
];
|
|
3683
|
-
};
|
|
3684
|
-
/**
|
|
3685
|
-
* 批次 77:列表前缀(paragraph)parity 种子。
|
|
3686
|
-
*
|
|
3687
|
-
* 覆盖面:有序多行逐行编号 / 无序 content 符号 / 窄盒自动换行视觉行续号 /
|
|
3688
|
-
* 行首字符样式覆写(前缀声明同款度量)/ center 对齐整体收边 / 装饰线与盒平移
|
|
3689
|
-
* 共存 / 竖排 left 对齐(列首前缀,不旋转)/ 无 paragraph 孪生锚(回归——
|
|
3690
|
-
* 纯文本零平移)。fabricReference 对 paragraph 键路由应用 Textbox(本批修复)。
|
|
3691
|
-
*
|
|
3692
|
-
* variant='ordered-only' 只返回 pp0(有序三行):全帧 parity 的失配底有
|
|
3693
|
-
* ~4% 的字形边缘 AA 噪声(与「引擎丢前缀」的 4.6~8.3% 重叠,批次 61 假绿
|
|
3694
|
-
* 同款坑),单对象口径绿 0.83% 才有判别力——e2e 双门:全帧 ≤5% 门(回归
|
|
3695
|
-
* 面)+ ordered-only ≤1.5% 门(前缀保真判别器)。
|
|
3696
|
-
*/
|
|
3697
|
-
export const makeTextParagraphScene = (variant) => {
|
|
3698
|
-
const base = (over) => ({
|
|
3699
|
-
type: 'textbox',
|
|
3700
|
-
scaleX: 1,
|
|
3701
|
-
scaleY: 1,
|
|
3702
|
-
angle: 0,
|
|
3703
|
-
originX: 'left',
|
|
3704
|
-
originY: 'top',
|
|
3705
|
-
opacity: 1,
|
|
3706
|
-
strokeWidth: 0,
|
|
3707
|
-
visible: true,
|
|
3708
|
-
fontFamily: 'sans-serif',
|
|
3709
|
-
lineHeight: 1.16,
|
|
3710
|
-
textAlign: 'left',
|
|
3711
|
-
fill: 'rgba(26,26,26,0.95)',
|
|
3712
|
-
...over
|
|
3713
|
-
});
|
|
3714
|
-
const ordered = { id: 0, type: 0, content: '1' };
|
|
3715
|
-
const pp0 = () =>
|
|
3716
|
-
// 有序三行(硬换行):前缀 1/2/3 + 三行全部右移
|
|
3717
|
-
({ ...base({ left: 80, top: 60, width: 520, text: '一一列表条目\n二二列表条目\n三三列表条目', fontSize: 44, paragraph: ordered }), id: 'pp0' });
|
|
3718
|
-
if (variant === 'ordered-only')
|
|
3719
|
-
return [
|
|
3720
|
-
pp0(),
|
|
3721
|
-
// 宽 content 前缀('●●●'≈3em 位移):丢前缀时整行大位移——判别信号放大器
|
|
3722
|
-
//(数字前缀 ~0.5em 位移的失配只比 AA 底噪高一倍,门不稳)
|
|
3723
|
-
{ ...base({ left: 820, top: 60, width: 560, text: '宽前缀位移条目\n第二行宽前缀\n第三行宽前缀\n第四行宽前缀', fontSize: 44, paragraph: { id: 1, type: 0, content: '●●●●' } }), id: 'pp1w' }
|
|
3724
|
-
];
|
|
3725
|
-
return [
|
|
3726
|
-
pp0(),
|
|
3727
|
-
// 无序 content 符号前缀
|
|
3728
|
-
{ ...base({ left: 820, top: 60, width: 560, text: '无序符号条目', fontSize: 44, paragraph: { id: 1, type: 0, content: '·' } }), id: 'pp1' },
|
|
3729
|
-
// 窄盒自动换行:视觉行续号(wrap 不吃前缀、measure 后编号递增)
|
|
3730
|
-
{ ...base({ left: 80, top: 250, width: 430, text: '自动换行条目内容较长跨行后视觉行编号继续递增', fontSize: 40, paragraph: ordered }), id: 'pp2' },
|
|
3731
|
-
// 行首字符样式覆写(fontSize 60 + 填充色):前缀用同款声明度量与绘制
|
|
3732
|
-
{
|
|
3733
|
-
...base({
|
|
3734
|
-
left: 820,
|
|
3735
|
-
top: 250,
|
|
3736
|
-
width: 560,
|
|
3737
|
-
text: '行首字符样式前缀',
|
|
3738
|
-
fontSize: 40,
|
|
3739
|
-
paragraph: ordered,
|
|
3740
|
-
styles: { 0: { 0: { fontSize: 60, fill: '#F96023' } } }
|
|
3741
|
-
}),
|
|
3742
|
-
id: 'pp3'
|
|
3743
|
-
},
|
|
3744
|
-
// center 对齐:前缀+文字整体收边(getLineWidth 含前缀宽)
|
|
3745
|
-
{ ...base({ left: 80, top: 460, width: 520, text: '居中对齐整体收边\n第二行居中收边', fontSize: 40, textAlign: 'center', paragraph: ordered }), id: 'pp4' },
|
|
3746
|
-
// 装饰线与盒平移共存(underline run 从平移后的盒起跑,前缀区不画线)
|
|
3747
|
-
{ ...base({ left: 820, top: 460, width: 560, text: '装饰线与前缀共存', fontSize: 40, underline: true, paragraph: ordered }), id: 'pp5' },
|
|
3748
|
-
// 竖排 left 对齐:列首前缀不旋转(fabric 前缀块无竖排分支)
|
|
3749
|
-
{ ...base({ left: 80, top: 640, width: 300, text: '竖排\n编号条目', fontSize: 40, vertical: true, paragraph: ordered }), id: 'pp6' },
|
|
3750
|
-
// 无 paragraph 孪生锚:纯文本零平移(回归锚)
|
|
3751
|
-
{ ...base({ left: 820, top: 640, width: 560, text: '无前缀孪生锚文本', fontSize: 44 }), id: 'pp7' }
|
|
3752
|
-
];
|
|
3753
|
-
};
|
|
3754
|
-
/**
|
|
3755
|
-
* 圆角场景(批次 98:rect rx/ry + 图片 rx/ry 承接)。
|
|
3756
|
-
* 五形态一对照:
|
|
3757
|
-
* - rr-fr:FabricRect 视觉 radius 源(render 每帧 rx=(1/sx)·radius 反算——引擎
|
|
3758
|
-
* 同式),红 #ef4444
|
|
3759
|
-
* - rr-rect:轻量 Rect 直读 rx/ry(30/14 椭圆角——SDF 椭圆零值面),蓝 #3b82f6
|
|
3760
|
-
* - rr-img:图片族 rx(uniform r = min(max(rx,ry),w/2,h/2),应用
|
|
3761
|
-
* getRoundedClipRadius 同式),本地木纹素材(离线确定性)
|
|
3762
|
-
* - rr-clip:rect 宿主 + 圆角 rect clipPath(居中全幅窗——CPU kappa 剪影/
|
|
3763
|
-
* GPU 圆角网格两路;批次 99 修复 maskInv 列主序打包错+反馈环后验收面)
|
|
3764
|
-
* - rr-poly:polygon(mesh) 宿主 clip(批次 99 反馈环回归锚——修复前 mesh 进
|
|
3765
|
-
* FBO 即 INVALID_OPERATION 全灭)
|
|
3766
|
-
* - rr-scale:FabricRect radius + 非均匀 scale(视觉圆角不随 scale 变椭圆)
|
|
3767
|
-
* - rr-sharp:直角对照(探针自校准——角点应=填充色而非底板色)
|
|
3768
|
-
* 板底 #eef1f4(角落探针=板色即「圆角裁掉」,=填充色即红态直角形态)。
|
|
3769
|
-
*/
|
|
3770
|
-
export const makeRoundedCornerScene = () => {
|
|
3771
|
-
const base = (over) => ({ scaleX: 1, scaleY: 1, angle: 0, originX: 'left', originY: 'top', opacity: 1, strokeWidth: 0, visible: true, ...over });
|
|
3772
|
-
return [
|
|
3773
|
-
base({ type: 'rect', id: 'WorkSpaceDrawType', left: 0, top: 0, width: 2000, height: 1400, fill: '#eef1f4' }),
|
|
3774
|
-
base({ type: 'FabricRect', id: 'rr-fr', left: 60, top: 80, width: 220, height: 160, radius: 40, fill: '#ef4444' }),
|
|
3775
|
-
base({ type: 'Rect', id: 'rr-rect', left: 340, top: 80, width: 220, height: 160, rx: 30, ry: 14, fill: '#3b82f6' }),
|
|
3776
|
-
base({ type: 'image', id: 'rr-img', left: 620, top: 80, width: 220, height: 160, rx: 36, src: assetUrl('../../assets/images/retina_wood.png') }),
|
|
3777
|
-
{
|
|
3778
|
-
...base({ type: 'rect', id: 'rr-clip', left: 60, top: 320, width: 220, height: 160, fill: '#eab308' }),
|
|
3779
|
-
// fabric 相对 clipPath 语义:left/top 从宿主中心度量、锚 clip 原点(含
|
|
3780
|
-
// origin 折算)——居中全幅窗 = (-w/2, -h/2)(批次 99 勘误:初版 0/0 把窗
|
|
3781
|
-
// 摆到宿主右下角,恰成「宿主不可见」假象)
|
|
3782
|
-
clipPath: { type: 'rect', left: -110, top: -80, width: 220, height: 160, rx: 40 }
|
|
3783
|
-
},
|
|
3784
|
-
base({ type: 'FabricRect', id: 'rr-scale', left: 340, top: 320, width: 220, height: 160, radius: 40, scaleX: 1.5, scaleY: 1, fill: '#8b5cf6' }),
|
|
3785
|
-
{
|
|
3786
|
-
// shape(mesh) 宿主 clip 回归锚(批次 99:反馈环修复的观测面——修复前
|
|
3787
|
-
// mesh 进 FBO 即 INVALID_OPERATION 全灭)
|
|
3788
|
-
...base({
|
|
3789
|
-
type: 'polygon',
|
|
3790
|
-
id: 'rr-poly',
|
|
3791
|
-
left: 700,
|
|
3792
|
-
top: 330,
|
|
3793
|
-
opacity: 0.7,
|
|
3794
|
-
fill: 'rgba(40,40,80,0.9)',
|
|
3795
|
-
points: [
|
|
3796
|
-
{ x: 0, y: 0 },
|
|
3797
|
-
{ x: 120, y: 12 },
|
|
3798
|
-
{ x: 100, y: 80 },
|
|
3799
|
-
{ x: 12, y: 74 }
|
|
3800
|
-
]
|
|
3801
|
-
}),
|
|
3802
|
-
clipPath: { type: 'rect', left: 10, top: 10, width: 60, height: 40 }
|
|
3803
|
-
},
|
|
3804
|
-
base({ type: 'rect', id: 'rr-sharp', left: 620, top: 320, width: 220, height: 160, fill: '#22c55e' })
|
|
3805
|
-
];
|
|
3806
|
-
};
|
|
1
|
+
var b=e=>{let t=e>>>0;return()=>{t|=0,t=t+1831565813|0;let o=Math.imul(t^t>>>15,1|t);return o=o+Math.imul(o^o>>>7,61|o)^o,((o^o>>>14)>>>0)/4294967296}},S=e=>Math.round(e*255).toString(16).padStart(2,"0"),D=(e,t=42,o={width:2e3,height:1400})=>{let i=b(t),r=[];for(let l=0;l<e;l++){let s=20+Math.floor(i()*120),a=20+Math.floor(i()*120);r.push({type:"rect",id:`r${l}`,left:Math.floor(i()*(o.width-s)),top:Math.floor(i()*(o.height-a)),width:s,height:a,scaleX:1,scaleY:1,angle:0,fill:`#${S(.2+i()*.8)}${S(.2+i()*.8)}${S(.2+i()*.8)}`,opacity:1,originX:"left",originY:"top",strokeWidth:0,visible:!0})}return r},d=e=>new URL(e,import.meta.url).href,m=[d("../../assets/images/retina_wood.png"),d("../../assets/images/nasty_fabric.png"),d("../../assets/images/greyfloral.png"),d("../../assets/images/honey_im_subtle.png"),d("../../assets/images/rotate.png"),"/gaoding-material/02/material_uploader/202106250601-e23c.jpg?x-oss-process=image/resize,w_640","/gaoding-material/02/material_uploader/202107060252-d51f.jpg?x-oss-process=image/resize,w_640"],w=(e,t=7,o={width:2e3,height:1400})=>{let i=b(t),r=[];for(let l=0;l<e;l++){let s=1+i()*.5;r.push({type:"image",id:`img${l}`,left:Math.floor(i()*o.width),top:Math.floor(i()*o.height),scaleX:s,scaleY:s,angle:Math.round(i()*4)*15,flipX:i()>.7,originX:"left",originY:"top",opacity:1,src:m[Math.floor(i()*m.length)],strokeWidth:0,visible:!0})}return r},R=()=>{let e=p=>`data:image/svg+xml;base64,${btoa(p)}`,o=b(39),i=(p,g)=>p<8&&g<8||p>12&&g<8||p<8&&g>12,r="";for(let p=0;p<21;p++)for(let g=0;g<21;g++)!i(g,p)&&o()>.52&&(r+=`<rect x="${g}" y="${p}" width="1" height="1"/>`);let l=(p,g)=>`<rect x="${p}" y="${g}" width="7" height="7" fill="none" stroke="#000" stroke-width="1"/><rect x="${p+2}" y="${g+2}" width="3" height="3"/>`,s=`<svg xmlns="http://www.w3.org/2000/svg" width="118" height="118" viewBox="0 0 21 21"><rect width="21" height="21" fill="#fff"/><g fill="#000">${r}</g><g fill="#000">${l(0,0)}${l(14,0)}${l(0,14)}</g></svg>`,a=b(77),n="",f=4;for(;f<192;){let p=2+Math.floor(a()*5);n+=`<rect x="${f}" y="12" width="${p}" height="56"/>`,f+=p+2+Math.floor(a()*4)}let c=`<svg xmlns="http://www.w3.org/2000/svg" width="200" height="80" viewBox="0 0 200 80"><rect width="200" height="80" fill="#fff"/><g fill="#000">${n}</g></svg>`,h='<svg xmlns="http://www.w3.org/2000/svg" width="160" height="160" viewBox="0 0 160 160"><rect width="160" height="160" fill="#fff"/><circle cx="62" cy="66" r="40" fill="#1f66ff"/><path d="M84 34 L140 118 L28 118 Z" fill="#ff8d23"/><circle cx="118" cy="106" r="22" fill="none" stroke="#111" stroke-width="6"/></svg>',u={scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,crossOrigin:"anonymous"};return[{...u,type:"QRCode",id:"qr0",left:120,top:100,src:e(s),codeContent:"https://yft.design",codeOption:{codeStyle:"A1",codeSpace:!1,codeError:0}},{...u,type:"QRCode",id:"qr1",left:360,top:100,angle:30,scaleX:1.5,scaleY:1.5,src:e(s),codeContent:"https://yft.design",codeOption:{codeStyle:"A1",codeSpace:!1,codeError:0}},{...u,type:"BarCode",id:"bar0",left:120,top:360,src:e(c),codeContent:"YFT-39",codeOption:{format:"code128",width:2,height:40,displayValue:!0,background:"#ffffff"}},{...u,type:"svgimage",id:"svg0",left:420,top:320,src:e(h)}]},k=()=>{let e={type:"image",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,src:d("../../assets/images/nasty_fabric.png")},t=d("../../assets/images/greyfloral.png"),o=d("../../assets/images/rotate.png"),i=d("../../assets/images/retina_wood.png");return[{...e,id:"cr0",left:60,top:40,scaleX:1.5,scaleY:1.5,cropX:40,cropY:30,width:160,height:170},{...e,id:"cr1",left:320,top:40,src:o,cropX:30,cropY:20,width:100,height:80,cropSizeMode:"visible"},{...e,id:"cr2",left:560,top:60,src:t,angle:30,flipX:!0,scaleX:1.6,scaleY:1.6,cropX:25,cropY:19,width:125,height:105},{...e,id:"cr3",left:60,top:320,src:i,scaleX:.9,scaleY:.9,cropX:100,cropY:120,width:200,height:160,cropSizeMode:"visible",shadow:{color:"rgba(40,40,60,0.45)",blur:12,offsetX:10,offsetY:10,affectStroke:!1,nonScaling:!1}},{...e,id:"cr4",left:360,top:340,src:t,angle:15,scaleX:1.8,scaleY:1.8,cropX:20,cropY:12,width:96,height:84,cropSizeMode:"visible",effects:{dropShadow:[{enabled:!0,showInDialog:!0,fill:"rgba(60,50,40,0.45)",blur:10,offsetX:12,offsetY:12}]}},{...e,id:"cr5",left:760,top:330,scaleX:1.3,scaleY:.8,cropX:58,cropY:0,width:198,height:200}]},H=()=>{let e={type:"image",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,src:d("../../assets/images/nasty_fabric.png")};return[{...e,id:"so0",left:60,top:40,layer:"Hero Title",smartObject:{id:"placed-1",placed:"plc-1",name:"hero-title",type:"image",width:480,height:360,transform:[0,0,480,0,480,360,0,360],parseStatus:"success"}},{...e,id:"so1",left:320,top:40,angle:15,scaleX:1.4,scaleY:1.2,layer:"Badge Layer",smartObject:{id:"placed-2",name:"",parseStatus:"success"}},{...e,id:"so2",left:580,top:40,layer:"Plain Photo"}]},z=()=>{let e={type:"image",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,src:d("../../assets/images/rotate.png")},t=d("../../assets/images/nasty_fabric.png"),o=r=>({left:40+r%4*240,top:40+Math.floor(r/4)*240}),i=(r,l,s={})=>({...e,id:`f${r}`,...o(r),filters:l,...s});return[i(0,[{type:"Brightness",brightness:.3}]),i(1,[{type:"Contrast",contrast:.35}]),i(2,[{type:"Saturation",saturation:.5}]),i(3,[{type:"Vibrance",vibrance:.4}]),i(4,[{type:"HueRotation",rotation:.5}]),i(5,[{type:"Grayscale",mode:"average"}]),i(6,[{type:"Sepia",colorsOnly:!1}]),i(7,[{type:"Brownie",colorsOnly:!1}]),i(8,[{type:"Kodachrome",colorsOnly:!1}]),i(9,[{type:"Technicolor",colorsOnly:!1}]),i(10,[{type:"Polaroid",colorsOnly:!1}]),i(11,[{type:"BlackWhite",colorsOnly:!1}]),i(12,[{type:"Invert",invert:!0,alphaOnly:!1}]),i(13,[{type:"Convolute",opaque:!1,matrix:[0,-1,0,-1,5,-1,0,-1,0]}]),i(14,[{type:"Convolute",opaque:!1,matrix:[1,1,1,1,.7,-1,-1,-1,-1]}]),i(15,[{type:"BlendColor",color:"#ff6600",mode:"overlay",alpha:.4}]),i(16,[{type:"Blur",blur:8}]),i(17,[{type:"Pixelate",blocksize:6}]),i(18,[{type:"Vignette",intensity:.6}]),i(19,[{type:"Temperature",temperature:.5}]),i(20,[{type:"Posterize",levels:6}]),i(21,[{type:"FilmGrain",intensity:.35,seed:7.13}]),i(22,[{type:"Duotone",color1:"#2E003E",color2:"#FF6EC7"}]),i(23,[{type:"Sketch"}]),i(24,[{type:"ChromaticAberration",offset:6}]),i(25,[{type:"SoftFocus",blend:.6}]),i(26,[{type:"Threshold",threshold:128}]),i(27,[{type:"UnsharpMask",amount:1.2}]),i(28,[{type:"MotionBlur",distance:.15,angle:.3}]),i(29,[{type:"LensFlare",intensity:.8}]),i(30,[{type:"GradientMap",color0:"#0a0020",color1:"#ff4466",color2:"#ffdd44"}]),i(31,[{type:"GradientMap",color0:"#001040",color1:"#ffe0b0"}]),i(32,[{type:"Levels",blackPoint:30,whitePoint:220,gamma:1.4}]),i(33,[{type:"SurfaceBlur",radius:3,threshold:.2}]),i(34,[{type:"Exposure",exposure:.6,offset:0,gamma:1}]),i(35,[{type:"Brightness",brightness:.15},{type:"Contrast",contrast:.25},{type:"Vignette",intensity:.5}]),i(36,[{type:"Sepia",colorsOnly:!1}],{cropX:30,cropY:30,width:120,height:120,cropSizeMode:"visible"}),i(37,[{type:"Duotone",color1:"#102040",color2:"#FFD070"}],{src:t,angle:25,flipX:!0,scaleX:1.4,scaleY:1.4}),i(38,[{type:"Grayscale",mode:"luminosity"}],{shadow:{color:"rgba(40,40,60,0.45)",blur:12,offsetX:10,offsetY:10,affectStroke:!1,nonScaling:!1}}),i(39,[{type:"Technicolor",colorsOnly:!1}],{angle:15,scaleX:1.3,scaleY:1.3,effects:{dropShadow:[{enabled:!0,showInDialog:!0,fill:"rgba(60,50,40,0.45)",blur:10,offsetX:12,offsetY:12}]}})]},Y=()=>{let e={type:"textbox",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,fill:"#1a1a1a"};return[{...e,id:"t0",left:80,top:60,width:620,text:"你好,WebGL2 设计引擎!字形图集渲染。",fontFamily:"sans-serif",fontSize:56,fontWeight:"bold",lineHeight:1.16,charSpacing:0,textAlign:"left"},{...e,id:"t6",left:80,top:640,width:560,text:"Rich text with per char colors and highlight marks 你好。",fontFamily:"sans-serif",fontSize:38,lineHeight:1.3,charSpacing:0,textAlign:"left",fill:"#101010",styles:{0:{0:{fill:"#c03030"},1:{fill:"#c03030"},2:{fill:"#c03030"},3:{fill:"#c03030"},10:{fill:"#2060c0",textBackgroundColor:"#ffe08a"},11:{fill:"#2060c0",textBackgroundColor:"#ffe08a"},12:{fill:"#2060c0",textBackgroundColor:"#ffe08a"},13:{fill:"#2060c0",textBackgroundColor:"#ffe08a"},14:{fill:"#2060c0",textBackgroundColor:"#ffe08a"}}}},{...e,id:"t1",left:80,top:200,width:400,text:"The quick brown fox jumps over the lazy dog and wraps here.",fontFamily:"serif",fontSize:40,lineHeight:1.25,charSpacing:0,textAlign:"left",fill:"#2050a0"},{...e,id:"t2",left:80,top:420,width:520,text:`居中对齐的中文标题
|
|
2
|
+
第二行小字 world`,fontFamily:"sans-serif",fontSize:48,lineHeight:1.4,charSpacing:80,textAlign:"center",fill:"#a03030"},{...e,id:"t3",left:700,top:60,width:460,text:"右对齐 Right aligned with spacing.",fontFamily:"monospace",fontSize:32,lineHeight:1.16,charSpacing:50,textAlign:"right",fill:"#106010"},{...e,id:"t4",left:700,top:240,width:480,text:"自动换行的中文长句会按照盒宽在词语与字符之间断行,验证 CJK 换行状态机。",fontFamily:"sans-serif",fontSize:36,lineHeight:1.5,charSpacing:0,textAlign:"left",fill:"#404040"},{...e,id:"t5",left:700,top:520,width:480,text:"不换行的 text 类型:Single line no wrap.",type:"text",fontFamily:"serif",fontSize:34,lineHeight:1.16,charSpacing:0,textAlign:"left",fill:"#704080"},{...e,id:"t7",left:700,top:585,width:460,text:"Mixed sizes Big word fonts 混排字号.",fontFamily:"sans-serif",fontSize:24,lineHeight:1.35,charSpacing:0,textAlign:"left",fill:"#303030",styles:{0:{6:{fontSize:40,fill:"#c03030"},7:{fontSize:40,fill:"#c03030"},8:{fontSize:40,fill:"#c03030"},9:{fontSize:40,fill:"#c03030"},10:{fontSize:40,fill:"#c03030"},12:{fontSize:36,fontFamily:"serif"},13:{fontSize:36,fontFamily:"serif"},14:{fontSize:36,fontFamily:"serif"},16:{fontSize:30,fontFamily:"monospace"},17:{fontSize:30,fontFamily:"monospace"},18:{fontSize:30,fontFamily:"monospace"},19:{fontSize:30,fontFamily:"monospace"}}}},{...e,id:"t8",left:700,top:672,text:"Cursor in mixed 123",type:"text",fontFamily:"sans-serif",fontSize:26,lineHeight:1.16,charSpacing:0,textAlign:"left",fill:"#106040",styles:{0:{17:{fontSize:44},18:{fontSize:44}}}},{...e,id:"t9",left:80,top:760,width:400,text:`The quick brown fox jumps over the lazy dog
|
|
3
|
+
wrapword.`,fontFamily:"serif",fontSize:40,lineHeight:1.25,charSpacing:0,textAlign:"justify",fill:"#303030"},{...e,id:"t10",left:700,top:760,width:460,text:`两端对齐的中英混排 stretch spaces between words
|
|
4
|
+
CJK 行没有空格不可拉伸`,fontFamily:"sans-serif",fontSize:28,lineHeight:1.35,charSpacing:0,textAlign:"justify-center",fill:"#204080"}]},X=()=>{let e={type:"textbox",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,fill:"#1a1a1a"};return[{...e,id:"k0",left:40,top:30,width:560,text:"描边标题 Outline",fontFamily:"sans-serif",fontSize:56,fontWeight:"bold",lineHeight:1.16,stroke:"#c03030",strokeWidth:8,paintFirst:"fill"},{...e,id:"k1",left:640,top:30,width:560,text:"Stroke First 外描边",fontFamily:"sans-serif",fontSize:56,fontWeight:"bold",lineHeight:1.16,stroke:"#c03030",strokeWidth:8,paintFirst:"stroke"},{...e,id:"k2",left:40,top:160,width:560,text:"纯描边 Outline only",fontFamily:"serif",fontSize:48,lineHeight:1.16,fill:"",stroke:"#2060c0",strokeWidth:3},{...e,id:"k3",left:640,top:160,width:560,text:"Per char stroke 逐字描边",fontFamily:"sans-serif",fontSize:40,lineHeight:1.3,fill:"#202020",stroke:"#104010",strokeWidth:3,styles:{0:{0:{strokeWidth:12,stroke:"#c03030"},1:{strokeWidth:12,stroke:"#c03030"},2:{strokeWidth:12,stroke:"#c03030"},4:{stroke:"#7030a0",strokeWidth:8},5:{stroke:"#7030a0",strokeWidth:8},6:{stroke:"#7030a0",strokeWidth:8},7:{stroke:"#7030a0",strokeWidth:8}}}},{...e,id:"k4",left:40,top:290,width:700,text:"default width 缺省线宽",fontFamily:"monospace",fontSize:44,lineHeight:1.16,fill:"#303030",stroke:"#704080"},{...e,id:"k5",left:640,top:300,width:560,text:"no stroke, width 6 只有宽度",fontFamily:"sans-serif",fontSize:40,lineHeight:1.16,fill:"#202020",strokeWidth:6},{...e,id:"k6",left:40,top:420,width:700,text:"带缩放与角度 描边",fontFamily:"sans-serif",fontSize:44,fontWeight:"bold",lineHeight:1.16,fill:"#1a1a1a",stroke:"#e0a020",strokeWidth:5,scaleX:1.2,scaleY:.9,angle:8},{...e,id:"k7",left:640,top:440,width:560,text:`两行描边文本
|
|
5
|
+
second line`,fontFamily:"sans-serif",fontSize:36,lineHeight:1.3,fill:"#202020",stroke:"rgba(16, 96, 64, 0.6)",strokeWidth:2.5}]},W=()=>{let e={type:"textbox",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,fill:"#1a1a1a"};return[{...e,id:"d0",left:40,top:30,width:560,text:"下划线标题 Underline",fontFamily:"sans-serif",fontSize:52,fontWeight:"bold",lineHeight:1.16,underline:!0},{...e,id:"d1",left:640,top:30,width:560,text:"删除线 Strikethrough",fontFamily:"serif",fontSize:46,lineHeight:1.16,linethrough:!0,fill:"#803030"},{...e,id:"d2",left:40,top:160,width:560,text:"上划线 Overline",fontFamily:"monospace",fontSize:40,lineHeight:1.16,overline:!0,fill:"#206080"},{...e,id:"d3",left:640,top:160,width:620,text:"Per char style 装饰线",fontFamily:"sans-serif",fontSize:40,lineHeight:1.3,fill:"#303030",styles:{0:{0:{underline:!0,fill:"#c03030"},1:{underline:!0,fill:"#c03030"},2:{underline:!0,fill:"#c03030"},4:{underline:!0,fill:"#2060c0"},5:{underline:!0,fill:"#2060c0"},6:{underline:!0,fill:"#2060c0"},7:{underline:!0,fill:"#2060c0"},9:{underline:!0},10:{underline:!0},11:{underline:!0},12:{underline:!0},13:{underline:!0},15:{underline:!0,fill:"#106040"},16:{underline:!0,fill:"#106040"},17:{underline:!0,fill:"#106040"}}}},{...e,id:"d4",left:40,top:300,width:620,text:"粗线 Thick 线宽覆写",fontFamily:"sans-serif",fontSize:44,lineHeight:1.2,underline:!0,fill:"#404040",styles:{0:{0:{textDecorationThickness:250},1:{textDecorationThickness:250},3:{textDecorationThickness:200},4:{textDecorationThickness:200},5:{textDecorationThickness:200},6:{textDecorationThickness:200},7:{textDecorationThickness:200}}}},{...e,id:"d5",left:640,top:320,width:560,text:"字距 Spacing 下划线",fontFamily:"serif",fontSize:40,lineHeight:1.16,charSpacing:80,underline:!0,fill:"#505030"},{...e,id:"d6",left:40,top:430,width:620,text:"Mixed sizes 装饰线",fontFamily:"sans-serif",fontSize:24,lineHeight:1.35,underline:!0,fill:"#303030",styles:{0:{0:{fontSize:44},1:{fontSize:44},2:{fontSize:44},3:{fontSize:44},4:{fontSize:44}}}},{...e,id:"d7",left:640,top:450,width:560,text:`三线全开
|
|
6
|
+
second line`,fontFamily:"sans-serif",fontSize:34,lineHeight:1.3,underline:!0,overline:!0,linethrough:!0,fill:"#402050",scaleX:1.15,scaleY:.95,angle:6}]},P=()=>{let e={type:"rect",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0},t=(i,r,l,s,a,n={})=>({type:"linear",coords:{x1:i,y1:r,x2:l,y2:s},colorStops:a.map(([f,c])=>({offset:f,color:c})),offsetX:0,offsetY:0,gradientUnits:"pixels",...n}),o=(i,r,l,s,a,n,f)=>({type:"radial",coords:{x1:i,y1:r,r1:l,x2:s,y2:a,r2:n},colorStops:f.map(([c,h])=>({offset:c,color:h})),offsetX:0,offsetY:0,gradientUnits:"pixels"});return[{...e,id:"g0",left:60,top:40,width:240,height:140,fill:t(0,0,240,0,[[0,"#c03030"],[1,"#e0c030"]])},{...e,id:"g1",left:340,top:40,width:240,height:140,fill:t(0,0,0,140,[[0,"#2050c0"],[.5,"#e8e8f0"],[1,"#30a050"]])},{...e,id:"g2",left:620,top:40,width:240,height:140,angle:20,scaleX:1.2,scaleY:.9,fill:t(0,0,240,140,[[0,"#7030a0"],[1,"#30b0b0"]])},{...e,id:"g3",type:"ellipse",left:920,top:50,rx:120,ry:80,fill:o(120,80,0,120,80,110,[[0,"#e06030"],[1,"#f0e0d0"]])},{...e,id:"g4",type:"circle",left:60,top:220,radius:90,fill:o(60,90,10,95,60,90,[[0,"#2060c0"],[1,"#d0e0f0"]])},{...e,id:"g5",left:280,top:220,width:240,height:160,fill:{type:"linear",coords:{x1:0,y1:0,x2:1,y2:1},colorStops:[{offset:0,color:"#108060"},{offset:1,color:"#e0a020"}],offsetX:0,offsetY:0,gradientUnits:"percentage"}},{...e,id:"g6",left:560,top:220,width:280,height:160,fill:t(0,0,280,0,[[0,"#c02060"],[.45,"rgba(255,200,80,0.25)"],[1,"#2060a0"]])},{...e,id:"g7",type:"polygon",left:880,top:210,points:[{x:0,y:0},{x:180,y:0},{x:180,y:60},{x:60,y:60},{x:60,y:170},{x:0,y:170}],fill:o(90,85,0,90,85,130,[[0,"#a03070"],[1,"#3070a0"]])},{...e,id:"g8",left:60,top:430,width:260,height:170,fill:t(0,0,260,0,[[0,"#b08020"],[1,"#40b060"]],{gradientTransform:[Math.cos(30*Math.PI/180),Math.sin(30*Math.PI/180),-Math.sin(30*Math.PI/180),Math.cos(30*Math.PI/180),0,0]})},{...e,id:"g9",left:360,top:430,width:260,height:170,opacity:.8,fill:t(0,0,260,0,[[0,"#4040c0"],[1,"#c04040"]],{offsetX:60,offsetY:40})}]},L=()=>{let e={type:"rect",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0},t=d("../../assets/images/nasty_fabric.png"),o=d("../../assets/images/greyfloral.png"),i=(s,a,n)=>{let f=n==="contain"?Math.min(s/150,a/124):Math.max(s/150,a/124);return[f,0,0,f,(s-150*f)/2,(a-124*f)/2]},r=`data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80"><defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#3f7fbf"/><stop offset="1" stop-color="#e0c060"/></linearGradient></defs><rect width="80" height="80" fill="url(#g)"/></svg>')}`,l=(s,a={})=>({type:"pattern",source:s,repeat:"repeat",offsetX:0,offsetY:0,patternTransform:null,...a});return[{...e,id:"p0",left:60,top:40,width:280,height:160,fill:l(t)},{...e,id:"p1",left:380,top:40,width:300,height:200,fill:l(o)},{...e,id:"p2",left:720,top:40,width:280,height:160,fill:l(t,{repeat:"repeat-x",patternTransform:[160/200,0,0,160/200,0,0]})},{...e,id:"p3",left:60,top:240,width:280,height:160,fill:l(t,{repeat:"repeat-y",patternTransform:[280/198,0,0,280/198,0,0]})},{...e,id:"p4",left:380,top:280,width:300,height:180,fill:l(o,{repeat:"no-repeat",patternTransform:i(300,180,"cover")})},{...e,id:"p5",left:720,top:240,width:280,height:180,fill:l(r,{patternTransform:[Math.cos(20*Math.PI/180),Math.sin(20*Math.PI/180),-Math.sin(20*Math.PI/180),Math.cos(20*Math.PI/180),0,0]})},{...e,id:"p6",type:"ellipse",left:60,top:440,rx:130,ry:85,fill:l(o)},{...e,id:"p7",type:"polygon",left:340,top:470,points:[{x:0,y:0},{x:200,y:0},{x:200,y:60},{x:70,y:60},{x:70,y:170},{x:0,y:170}],fill:l(t,{offsetX:30,offsetY:20})}]},I=()=>{let e={type:"rect",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,fill:"#e8e0d0"},t=(o,i,r,l,s={})=>({color:o,blur:i,offsetX:r,offsetY:l,affectStroke:!1,nonScaling:!1,...s});return[{...e,id:"sh0",left:60,top:40,width:240,height:140,fill:"#d0c8b8",shadow:t("rgba(40,40,60,0.45)",12,10,10)},{...e,id:"sh1",left:380,top:40,width:240,height:140,fill:"#c8d8c0",shadow:t("rgba(30,60,30,0.5)",0,14,8)},{...e,id:"sh2",left:700,top:40,width:240,height:140,fill:"#f0f0f0",shadow:t("rgba(160,60,200,0.5)",16,-8,12)},{...e,id:"sh3",left:1020,top:60,width:220,height:150,angle:30,scaleX:1.2,scaleY:.9,fill:"#d8ccc0",shadow:t("rgba(60,50,40,0.5)",10,12,12)},{...e,id:"sh4",type:"ellipse",left:60,top:240,rx:120,ry:78,fill:"#c0cad8",shadow:t("rgba(30,40,80,0.45)",14,8,10)},{...e,id:"sh5",type:"polygon",left:320,top:250,points:[{x:0,y:0},{x:180,y:0},{x:180,y:60},{x:60,y:60},{x:60,y:170},{x:0,y:170}],fill:"#d0d0c0",shadow:t("rgba(60,60,30,0.45)",12,10,10)},{...e,id:"sh6",type:"image",left:620,top:250,src:d("../../assets/images/nasty_fabric.png"),shadow:t("rgba(40,30,60,0.5)",12,10,10)},{...e,id:"sh7",type:"textbox",left:60,top:470,width:420,text:"阴影文本 Shadow text 逐字剪影",fontFamily:"sans-serif",fontSize:44,fontWeight:"bold",fill:"#303040",lineHeight:1.16,shadow:t("rgba(80,90,160,0.5)",8,6,8)},{...e,id:"sh8",left:540,top:470,width:240,height:150,scaleX:1.8,scaleY:1.4,fill:"#e0d8e8",shadow:t("rgba(60,40,60,0.5)",10,10,10,{nonScaling:!0})},{...e,id:"sh9",left:880,top:470,width:280,height:170,fill:{type:"linear",coords:{x1:0,y1:0,x2:280,y2:0},colorStops:[{offset:0,color:"#c06060"},{offset:1,color:"#6060c0"}],offsetX:0,offsetY:0,gradientUnits:"pixels"},shadow:t("rgba(40,40,40,0.5)",14,10,12)}]},v=()=>{let e={type:"image",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,src:d("../../assets/images/nasty_fabric.png")},t=(l,s,a,n,f={})=>({enabled:!0,showInDialog:!0,fill:l,blur:s,offsetX:a,offsetY:n,...f}),o=(l,s={})=>({enabled:!0,showInDialog:!0,fillType:0,fill:l,...s}),i=(l,s,a,n={})=>({enabled:!0,showInDialog:!0,fillType:1,fill:{type:l,colorStops:a.map(([f,c])=>({offset:f,color:c})),coords:s,gradientUnits:"percentage"},...n}),r=d("../../assets/images/greyfloral.png");return[{...e,id:"pe0",left:60,top:40,effects:{dropShadow:[t("rgba(40,40,60,0.45)",12,10,10)]}},{...e,id:"pe1",left:320,top:40,effects:{dropShadow:[t("rgba(160,60,60,0.4)",14,14,8),t("rgba(40,60,160,0.35)",8,-10,14)]}},{...e,id:"pe2",left:580,top:40,effects:{dropShadow:[t("rgba(30,60,30,0.5)",0,16,8)]}},{...e,id:"pe3",left:840,top:40,angle:25,scaleX:1.3,scaleY:.85,effects:{dropShadow:[t("rgba(60,50,40,0.45)",10,12,12)]}},{...e,id:"pe4",left:60,top:280,src:r,effects:{solidFill:[o("rgba(200,80,80,0.55)")]}},{...e,id:"pe5",left:320,top:280,src:r,effects:{dropShadow:[t("rgba(40,40,60,0.45)",10,8,10)],solidFill:[o("rgba(80,160,200,0.4)")]}},{...e,id:"pe6",left:580,top:280,opacity:.85,effects:{dropShadow:[t("rgba(120,60,160,0.45)",12,10,10)],solidFill:[o("rgba(240,200,80,0.5)"),o("rgba(80,200,140,0.3)")]}},{...e,id:"pe7",left:840,top:280,effects:{disabled:!0,dropShadow:[t("rgba(255,0,0,0.9)",20,20,20)]}},{...e,id:"pe8",left:60,top:520,src:r,effects:{solidFill:[i("linear",{x1:.5,y1:0,x2:.5,y2:1},[[0,"rgba(60,20,90,0.85)"],[.5,"rgba(200,60,120,0.55)"],[1,"rgba(240,220,80,0.1)"]])]}},{...e,id:"pe9",left:320,top:520,src:r,effects:{solidFill:[i("radial",{x1:.5,y1:.5,r1:0,x2:.5,y2:.5,r2:.6},[[0,"rgba(255,240,180,0.95)"],[.55,"rgba(230,120,50,0.5)"],[1,"rgba(60,20,90,0.8)"]])]}},{...e,id:"pe10",left:580,top:520,angle:18,src:r,effects:{dropShadow:[t("rgba(40,40,60,0.4)",10,8,10)],solidFill:[o("rgba(20,40,80,0.35)"),i("linear",{x1:.1,y1:.1,x2:.9,y2:.7},[[0,"rgba(120,220,140,0.7)"],[1,"rgba(180,40,60,0.25)"]])]}},{...e,id:"pe11",left:1060,top:40,src:r,effects:{stroke:[{enabled:!0,showInDialog:!0,fill:"rgba(60,60,200,1)",strokeWidth:6,strokeAlignment:"outside"},{enabled:!0,showInDialog:!0,fill:"rgba(255,255,255,0.95)",strokeWidth:16,strokeAlignment:"outside"}]}},{...e,id:"pe12",left:1060,top:260,src:r,effects:{stroke:[{enabled:!0,showInDialog:!0,fill:"rgba(230,120,40,0.9)",strokeWidth:14,strokeAlignment:"center"}]}},{...e,id:"pe13",left:1060,top:470,scaleX:.85,scaleY:.85,effects:{stroke:[{enabled:!0,showInDialog:!0,fill:"rgba(40,160,90,0.95)",strokeWidth:12,strokeAlignment:"inside"}]}}]},G=()=>{let e={type:"polygon",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0};return[{...e,id:"s0",type:"ellipse",left:80,top:60,rx:90,ry:60,fill:"#c04040"},{...e,id:"s1",type:"circle",left:320,top:60,radius:70,fill:"#2f6fbf"},{...e,id:"s2",type:"ellipse",left:540,top:60,rx:80,ry:50,angle:30,fill:"#3f8f5f"},{...e,id:"s3",type:"polygon",left:80,top:260,points:[{x:0,y:0},{x:120,y:0},{x:60,y:110}],fill:"#b07030"},{...e,id:"s4",type:"polygon",left:260,top:260,points:[{x:0,y:0},{x:120,y:0},{x:120,y:40},{x:40,y:40},{x:40,y:120},{x:0,y:120}],fill:"#7a4fa0"},{...e,id:"s5",type:"polygon",left:470,top:300,scaleX:1.4,scaleY:.8,points:[{x:60,y:0},{x:120,y:45},{x:95,y:115},{x:25,y:115},{x:0,y:45}],fill:"#108080"},{...e,id:"s6",type:"polyline",left:720,top:260,points:[{x:0,y:0},{x:120,y:50},{x:30,y:70},{x:140,y:140}],fill:"#a03070"},{...e,id:"s7",type:"polyline",left:720,top:470,points:[{x:0,y:0},{x:110,y:60},{x:20,y:120}],fill:""}]},O=()=>{let e={type:"Path",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0};return[{...e,id:"pa0",left:60,top:40,fill:"rgba(200,80,80,0.9)",path:[["M",10,10],["L",180,30],["L",60,140],["Z"]]},{...e,id:"pa1",left:320,top:40,fill:"rgba(80,140,220,0.9)",path:"M 10 100 C 40 -60 160 -60 190 100 C 220 40 120 160 100 120 Z"},{...e,id:"pa2",left:580,top:40,fill:"rgba(90,190,130,0.9)",path:"M 10 90 A 90 60 20 1 0 190 90 A 90 60 20 1 0 10 90 Z"},{...e,id:"pa3",left:840,top:40,fill:"rgba(160,100,200,0.9)",fillRule:"evenodd",path:"M 0 0 L 180 0 L 180 120 L 0 120 Z M 40 30 L 140 30 L 140 90 L 40 90 Z"},{...e,id:"pa4",left:60,top:260,fill:"rgba(230,160,60,0.9)",path:"M 0 0 L 180 0 L 180 120 L 0 120 Z M 40 30 L 40 90 L 140 90 L 140 30 Z"},{...e,id:"pa5",left:320,top:260,fill:"rgba(70,170,180,0.9)",fillRule:"evenodd",path:"M 0 0 L 200 0 L 200 150 L 0 150 Z M 30 25 L 170 25 L 170 125 L 30 125 Z M 80 55 Q 100 35 120 55 Q 140 75 120 95 Q 100 115 80 95 Q 60 75 80 55 Z"},{...e,id:"pa6",left:580,top:260,fill:{type:"linear",coords:{x1:0,y1:0,x2:1,y2:1},colorStops:[{offset:0,color:"rgba(120,40,180,0.95)"},{offset:1,color:"rgba(240,180,60,0.85)"}],gradientUnits:"percentage"},path:"M 20 130 C 60 20 160 20 190 110 C 150 60 90 70 20 130 Z"},{...e,id:"pa7",left:840,top:280,angle:20,scaleX:1.15,scaleY:.85,fill:"rgba(40,60,60,0.9)",path:"M 10 10 C 60 10 90 40 100 90 S 60 150 20 130 S -20 40 10 10 Z"}]},_=()=>{let e={type:"Path",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0};return[{...e,type:"Path",id:"p0",left:100,top:100,fill:"rgba(74,124,199,0.9)",path:[["M",10,10],["L",110,10],["L",110,90],["L",10,90],["Z"]]},{...e,type:"Path",id:"p1",left:320,top:100,fill:"rgba(199,74,143,0.9)",path:"M 10 60 C 40 -40 160 -40 190 60 C 160 140 40 140 10 60 Z"},{...e,type:"polygon",id:"pg0",left:100,top:300,fill:"rgba(90,170,110,0.9)",points:[{x:0,y:0},{x:100,y:0},{x:0,y:80}]},{...e,type:"Line",id:"ln0",left:320,top:300,stroke:"#333333",strokeWidth:4,x1:-60,y1:-40,x2:60,y2:40}]},j=()=>{let e={type:"polygon",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0},t=(o,i,r,l,s)=>{let a=[];for(let n=0;n<s*2;n++){let f=n%2===0?r:l,c=Math.PI/s*n-Math.PI/2;a.push({x:o+f*Math.cos(c),y:i+f*Math.sin(c)})}return a};return[{...e,id:"st0",left:60,top:40,fill:"rgba(250,235,200,0.9)",stroke:"rgba(60,60,120,0.95)",strokeWidth:5,points:t(90,75,70,30,5)},{...e,id:"st1",left:300,top:40,fill:"",stroke:"rgba(180,50,50,0.95)",strokeWidth:4,strokeDashArray:[12,8],strokeDashOffset:6,strokeLineCap:"round",points:t(90,75,70,32,6)},{...e,id:"st2",left:540,top:40,fill:"",stroke:"rgba(40,130,80,0.95)",strokeWidth:6,strokeDashArray:[16,10],strokeLineJoin:"bevel",strokeLineCap:"square",points:t(90,75,68,28,7)},{...e,id:"st3",type:"ellipse",left:800,top:40,rx:95,ry:62,fill:"rgba(210,230,250,0.8)",stroke:"rgba(150,40,140,0.95)",strokeWidth:5,strokeDashArray:[10,6],strokeLineJoin:"round"},{...e,id:"st4",left:60,top:240,scaleX:1.6,scaleY:.7,fill:"",stroke:"rgba(30,30,30,0.95)",strokeWidth:6,strokeUniform:!0,points:t(90,70,72,30,5)},{...e,id:"st5",left:340,top:240,scaleX:1.6,scaleY:.7,angle:15,fill:"rgba(255,255,255,0.5)",stroke:"rgba(200,120,20,0.95)",strokeWidth:4,points:t(90,70,72,30,5)},{...e,id:"st6",left:620,top:240,fill:"rgba(240,240,240,1)",stroke:"rgba(200,30,30,1)",strokeWidth:10,paintFirst:"stroke",points:t(90,70,72,34,5)},{...e,id:"st7",type:"Path",left:60,top:440,fill:"",stroke:"rgba(30,90,170,0.95)",strokeWidth:4,strokeLineJoin:"round",path:"M 10 90 C 40 -40 140 -40 170 90 S 90 150 10 90 Z"},{...e,id:"st8",type:"rect",left:320,top:450,width:220,height:130,angle:12,fill:"rgba(235,225,245,0.9)",stroke:"rgba(90,40,120,0.95)",strokeWidth:6},{...e,id:"st9",type:"circle",left:620,top:440,radius:70,fill:"",stroke:"rgba(20,20,20,0.9)",strokeWidth:3,strokeDashArray:[8,8]}]},Z=()=>{let e={type:"Path",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0},t=(o,i,r,l)=>({enabled:!0,showInDialog:!0,fill:o,blur:i,offsetX:r,offsetY:l});return[{...e,id:"px0",left:60,top:60,fill:"rgba(250,240,220,0.95)",path:"M 10 10 C 80 -30 160 20 180 90 C 120 150 30 130 10 10 Z",effects:{dropShadow:[t("rgba(40,40,80,0.5)",14,12,14)]}},{...e,id:"px1",left:340,top:60,fill:"rgba(220,240,250,0.95)",path:"M 20 120 C 60 20 160 20 190 100 C 150 150 60 150 20 120 Z",effects:{dropShadow:[t("rgba(160,60,60,0.45)",16,16,10),t("rgba(60,60,160,0.4)",8,-12,16)]}},{...e,id:"px2",left:620,top:60,fill:"rgba(200,220,160,0.55)",path:"M 10 110 C 50 10 150 10 180 110 C 130 150 60 150 10 110 Z",effects:{dropShadow:[t("rgba(30,60,30,0.6)",12,10,12)]}},{...e,id:"px3",left:900,top:60,fill:"",path:"M 10 10 L 150 10 L 150 120 L 10 120 Z",effects:{dropShadow:[t("rgba(255,0,0,0.9)",20,20,20)]}},{...e,id:"px4",left:60,top:340,fill:"rgba(240,235,245,1)",stroke:"rgba(150,60,140,1)",strokeWidth:8,strokeAlignment:"outside",path:"M 10 100 C 40 10 140 10 170 100 C 120 150 50 150 10 100 Z"},{...e,id:"px5",left:340,top:340,fill:"rgba(235,245,235,1)",stroke:"rgba(40,90,50,1)",strokeWidth:8,strokeAlignment:"inside",path:"M 10 100 C 40 10 140 10 170 100 C 120 150 50 150 10 100 Z"},{...e,id:"px6",left:620,top:350,angle:15,fill:"rgba(245,240,225,1)",stroke:"rgba(60,60,150,1)",strokeWidth:6,strokeAlignment:"outside",strokeDashArray:[14,8],path:"M 10 90 C 50 -20 150 -10 180 90 C 130 140 50 140 10 90 Z"},{...e,id:"px7",left:900,top:340,fill:"rgba(250,245,230,1)",stroke:"rgba(140,90,30,1)",strokeWidth:7,strokeAlignment:"outside",path:"M 15 100 C 45 15 145 15 175 100 C 125 150 55 150 15 100 Z",effects:{dropShadow:[t("rgba(60,40,20,0.5)",12,10,12)]}}]},$=()=>{let e={type:"Line",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,visible:!0},t=(o,i,r,l,s,a)=>({...e,x1:o,y1:i,x2:r,y2:l,left:s,top:a});return[{...t(-90,-35,90,35,150,75),id:"ln0",stroke:"rgba(40,40,60,0.95)",strokeWidth:3},{...t(-90,-30,90,30,150,185),id:"ln1",stroke:"rgba(160,50,50,0.95)",strokeWidth:4,strokeDashArray:[14,10],strokeDashOffset:7,strokeLineCap:"round"},{...t(-100,0,100,0,150,295),id:"ln2",stroke:"rgba(30,100,60,0.95)",strokeWidth:5},{...t(-90,-40,90,40,480,75),id:"ln3",type:"arrow",stroke:"rgba(50,50,150,0.95)",strokeWidth:3},{...t(-90,-35,90,35,480,185),id:"ln4",type:"arrow",stroke:"rgba(150,90,20,0.95)",strokeWidth:4,strokeDashArray:[12,8],arrowType:"both"},{...t(-80,-30,80,30,460,295),id:"ln5",type:"arrow",angle:20,scaleX:1.3,scaleY:.8,stroke:"rgba(120,30,120,0.95)",strokeWidth:3,arrowWidth:18,arrowHeight:27},{...t(-100,0,100,0,460,405),id:"ln9",type:"arrow",stroke:"rgba(30,30,30,0.95)",strokeWidth:3},{...t(-90,-25,90,25,820,75),id:"ln6",type:"Dimension",stroke:"rgba(30,30,30,0.95)",strokeWidth:2,text:"120 cm",textFontSize:28,textColor:"#333333",textBackgroundColor:"rgba(255,255,255,0.9)",textPadding:4,textFollowLine:!0},{...t(-80,-30,80,30,820,210),id:"ln7",type:"Dimension",angle:0,stroke:"rgba(90,30,30,0.95)",strokeWidth:3,text:"80mm",textFontSize:24,textFollowLine:!1},{...t(-100,-20,100,20,820,340),id:"ln8",type:"ReferenceLine",stroke:"rgba(200,40,80,0.9)",strokeWidth:2,strokeDashArray:[6,6]}]},B=()=>{let e={type:"textbox",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,fill:"rgba(250,248,240,0.95)",lineHeight:1.16};return[{...e,id:"kd0",left:40,top:40,width:560,text:"虚线描边 Dashed",fontFamily:"sans-serif",fontSize:56,fontWeight:"bold",stroke:"#c03030",strokeWidth:5,strokeDashArray:[10,7]},{...e,id:"kd1",left:640,top:40,width:560,text:`多行各自
|
|
7
|
+
重启相位
|
|
8
|
+
Dashed lines`,fontFamily:"sans-serif",fontSize:44,stroke:"#2060c0",strokeWidth:4,strokeDashArray:[8,6],strokeDashOffset:4},{...e,id:"kd2",left:40,top:200,width:560,text:"字距虚线 Spaced",fontFamily:"sans-serif",fontSize:48,stroke:"#207050",strokeWidth:4,strokeDashArray:[9,6],charSpacing:300},{...e,id:"kd3",left:640,top:240,width:560,text:"Outline dash only",fontFamily:"serif",fontSize:48,fill:"",stroke:"#803080",strokeWidth:3,strokeDashArray:[7,5],strokeLineCap:"round"},{...e,id:"kd4",left:40,top:380,width:560,text:"混排虚线 Mixed",fontFamily:"sans-serif",fontSize:48,stroke:"#303030",strokeWidth:4,strokeDashArray:[10,6],styles:{0:{2:{fontSize:64,stroke:"#c06020",fill:"rgba(255,255,255,0.95)"},3:{fontSize:64,stroke:"#c06020",fill:"rgba(255,255,255,0.95)"}}}},{...e,id:"kd5",left:640,top:420,width:520,angle:12,scaleX:1.1,scaleY:.9,text:"旋转虚线 Rotated",fontFamily:"sans-serif",fontSize:44,stroke:"#2060a0",strokeWidth:4,strokeDashArray:[8,5]}]},F=()=>{let e={type:"textbox",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,width:480,fontFamily:"sans-serif",fontSize:40,lineHeight:1.3,charSpacing:0,textAlign:"left",fill:"#c8c8c8"},t=(l,s,a,n)=>({enabled:!0,showInDialog:!0,fill:l,blur:s,offsetX:a,offsetY:n}),o=(l,s={})=>({enabled:!0,showInDialog:!0,fillType:0,fill:l,...s}),i=(l,s,a,n={})=>({enabled:!0,showInDialog:!0,fill:l,fillType:"color",size:{value:s},position:a,...n}),r=l=>({stroke:[],solidFill:[],dropShadow:[],outerGlow:{enabled:!0,showInDialog:!0},gradientOverlay:[],...l});return[{...e,id:"fx0",left:80,top:30,text:"Shadow 投影一层",effects:r({dropShadow:[t("rgba(40,40,80,0.45)",10,8,8)]})},{...e,id:"fx1",left:660,top:30,text:"多层投影 Multi shadow",effects:r({dropShadow:[t("rgba(160,60,60,0.4)",12,12,6),t("rgba(40,60,160,0.35)",6,-8,12)]})},{...e,id:"fx2",left:80,top:150,text:"Color overlay 色叠加",effects:r({solidFill:[o("rgba(30,140,140,0.55)")]})},{...e,id:"fx3",left:660,top:150,text:"描边外 Outside",effects:r({stroke:[i("rgba(200,60,60,0.95)",10,"outside")]})},{...e,id:"fx4",left:80,top:270,text:"描边居中 Center",effects:r({stroke:[i("rgba(230,140,40,0.95)",10,"center")]})},{...e,id:"fx5",left:660,top:270,text:"描边内 Inside",effects:r({stroke:[i("rgba(40,160,90,0.95)",8,"inside")]})},{...e,id:"fx6",left:80,top:390,text:"组合特效 Combo",effects:r({dropShadow:[t("rgba(30,30,60,0.4)",8,6,10)],solidFill:[o("rgba(200,200,80,0.5)")],stroke:[i("rgba(60,60,200,0.95)",5,"outside"),i("rgba(20,20,40,0.9)",14,"outside")]})},{...e,id:"fx7",left:660,top:390,angle:12,scaleX:1.15,scaleY:.9,text:`逐字混排 Rich
|
|
9
|
+
effects 字号`,styles:{0:{0:{fill:"#e0e0e0",fontSize:48},1:{fill:"#a0a0a0",fontSize:48},5:{fontSize:30}}},effects:r({dropShadow:[t("rgba(60,30,60,0.45)",9,7,9)],stroke:[i("rgba(120,40,160,0.9)",6,"outside")]})},{...e,id:"fx8",left:80,top:510,text:"效果偏移 Offset",effects:r({stroke:[i("rgba(200,60,60,0.9)",6,"outside",{offsetEnable:!0,offsetX:12,offsetY:6})]})},{...e,id:"fx9",left:660,top:510,opacity:.6,text:"半透明 Opacity",effects:r({dropShadow:[t("rgba(30,30,80,0.5)",10,8,8)],solidFill:[o("rgba(220,120,60,0.6)")]})}]},E=()=>{let e=(t,o,i)=>t.map(r=>({...r,left:(r.left??0)+o,top:(r.top??0)+i}));return[...e(Y(),0,0),...e(X(),1300,0),...e(W(),0,950),...e(F(),1300,950),...e(M(),0,1900),...e(A(),1300,1900),...e(C(),0,2850),...e(N(),1300,2850)]},U=()=>{let e=(t,o,i)=>t.map(r=>({...r,left:(r.left??0)+o,top:(r.top??0)+i}));return[...e(w(60,7),600,0),...e(v(),600,2500),...e(T(),2100,2500),...e(k(),600,3300),...e(z(),600,4200)]},N=()=>{let e=t=>({scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,...t});return[{...e({type:"Group",left:60,top:50,width:200,height:150}),id:"gr0",objects:[e({type:"rect",id:"gr0-c0",left:-100,top:-75,width:120,height:90,fill:"rgba(230,120,100,0.95)"}),e({type:"rect",id:"gr0-c1",left:-10,top:-30,width:110,height:105,fill:"rgba(100,150,220,0.95)"})]},{...e({type:"Group",left:340,top:40,width:200,height:145,angle:18,scaleX:1.15,scaleY:.85}),id:"gr1",objects:[e({type:"rect",id:"gr1-c0",left:-100,top:-72.5,width:130,height:70,fill:"rgba(160,110,210,0.95)"}),e({type:"ellipse",id:"gr1-c1",left:10,top:-37.5,rx:45,ry:55,fill:"rgba(120,200,150,0.95)"})]},{...e({type:"Group",left:640,top:60,width:210,height:170,angle:-12}),id:"gr2",objects:[e({type:"rect",id:"gr2-c0",left:-105,top:-85,width:90,height:170,fill:"rgba(240,200,90,0.95)"}),{...e({type:"Group",left:-5,top:-60,width:110,height:120,angle:25,scaleX:.9,scaleY:1.1}),id:"gr2-inner",objects:[e({type:"rect",id:"gr2-i0",left:-55,top:-60,width:110,height:55,fill:"rgba(80,140,190,0.95)"}),e({type:"rect",id:"gr2-i1",left:-40,top:0,width:80,height:60,fill:"rgba(200,90,120,0.95)"})]}]},{...e({type:"Group",left:60,top:300,width:229,height:99,angle:8}),id:"gr3",objects:[e({type:"Path",id:"gr3-c0",left:-114.5,top:-49.5,fill:"rgba(90,170,180,0.95)",path:"M 10 90 C 40 10 130 10 160 90 C 110 130 50 130 10 90 Z"}),e({type:"polygon",id:"gr3-c1",left:40.5,top:-29.5,fill:"rgba(250,240,210,0.95)",stroke:"rgba(150,60,60,0.95)",strokeWidth:4,points:[{x:0,y:0},{x:70,y:10},{x:55,y:75},{x:5,y:60}]})]},{...e({type:"Group",left:360,top:300,width:150,height:124,scaleX:1.1}),id:"gr4",objects:[e({type:"image",id:"gr4-c0",left:-75,top:-62,src:d("../../assets/images/greyfloral.png")})]},{...e({type:"Group",left:640,top:310,width:230,height:51,angle:-6}),id:"gr5",objects:[e({type:"textbox",id:"gr5-t0",left:-115,top:-25.5,width:230,text:"组内文本",fontFamily:"sans-serif",fontSize:44,fill:"rgba(40,40,70,0.95)",lineHeight:1.16})]},{...e({type:"Group",left:920,top:60,width:190,height:150,opacity:.55,angle:10}),id:"gr6",objects:[e({type:"rect",id:"gr6-c0",left:-95,top:-75,width:190,height:150,fill:"rgba(60,180,120,1)"}),e({type:"circle",id:"gr6-c1",left:-45,top:-45,radius:45,fill:"rgba(240,240,240,1)"})]},{...e({type:"Group",left:920,top:300,width:200,height:70}),id:"gr7",objects:[e({type:"rect",id:"gr7-r0",left:-100,top:-35,width:200,height:70,fill:"rgba(250,235,205,0.95)"}),e({type:"textbox",id:"gr7-t0",left:-92,top:-16,width:184,text:"矩形+文字",fontFamily:"sans-serif",fontSize:28,fill:"rgba(60,50,30,0.95)",lineHeight:1.16})]},{...e({type:"Group",left:60,top:480,width:190,height:130}),id:"gr8",objects:[e({type:"rect",id:"gr8-r0",left:-95,top:-65,width:190,height:130,fill:"rgba(245,228,196,0.95)"}),e({type:"image",id:"gr8-i0",left:-75,top:-62,src:d("../../assets/images/greyfloral.png")})]},{...e({type:"Group",left:300,top:480,width:150,height:152,angle:-8}),id:"gr9",objects:[e({type:"image",id:"gr9-i0",left:-75,top:-79.5,src:d("../../assets/images/greyfloral.png")}),e({type:"textbox",id:"gr9-t0",left:-75,top:49,width:150,text:"图片配文",fontFamily:"sans-serif",fontSize:20,fill:"rgba(40,40,70,0.95)",lineHeight:1.16})]},{...e({type:"Group",left:580,top:480,width:240,height:170}),id:"gr10",objects:[e({type:"rect",id:"gr10-r0",left:-120,top:-85,width:240,height:170,fill:"rgba(248,248,252,0.95)"}),e({type:"image",id:"gr10-i0",left:-95,top:-70,src:d("../../assets/images/greyfloral.png")}),e({type:"textbox",id:"gr10-t0",left:-100,top:58,width:200,text:"图+文+矩形",fontFamily:"sans-serif",fontSize:20,fill:"rgba(40,40,70,0.95)",lineHeight:1.16})]}]},V=()=>{let e=i=>({type:"Group",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,...i}),t=i=>({scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,...i}),o=(i,r,l)=>`data:image/svg+xml;utf8,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${r}"><defs><radialGradient id="m" cx="0.5" cy="0.5" r="0.5"><stop offset="0" stop-color="#ffffff"/><stop offset="0.7" stop-color="#808080"/><stop offset="1" stop-color="#000000"/></radialGradient></defs><rect width="${i}" height="${r}" fill="url(#m)"/></svg>`).replace("REMOVED",String(l))}`;return[{...e({left:60,top:50,width:200,height:150,mask:{src:o(200,150,0),offsetX:0,offsetY:0,width:200,height:150,scaleX:1,scaleY:1,defaultColor:0}}),id:"gm0",objects:[t({type:"rect",left:-100,top:-75,width:130,height:150,fill:"rgba(230,120,100,1)"}),t({type:"rect",left:-30,top:-75,width:130,height:150,fill:"rgba(100,150,220,1)"})]},{...e({left:340,top:50,width:200,height:150,mask:{src:o(120,90,255),offsetX:-40,offsetY:-30,width:120,height:90,scaleX:1,scaleY:1,defaultColor:255}}),id:"gm1",objects:[t({type:"rect",left:-100,top:-75,width:200,height:150,fill:"rgba(120,200,150,1)"})]},{...e({left:640,top:50,width:200,height:150,opacity:.6,mask:{src:o(200,150,0),offsetX:0,offsetY:0,width:200,height:150,scaleX:1,scaleY:1,defaultColor:0}}),id:"gm2",objects:[t({type:"rect",left:-100,top:-75,width:200,height:150,fill:"rgba(200,160,60,1)"}),t({type:"circle",left:-40,top:-55,radius:55,fill:"rgba(240,240,240,1)"})]},{...e({left:60,top:300,width:200,height:150,opacity:.55,angle:8}),id:"gm3",objects:[t({type:"rect",left:-100,top:-75,width:200,height:150,fill:"rgba(60,180,120,1)"}),t({type:"circle",left:-45,top:-45,radius:45,fill:"rgba(240,240,240,1)"})]},{...e({left:340,top:320,width:200,height:150,angle:18,scaleX:1.15,scaleY:.85,mask:{src:o(200,150,0),offsetX:0,offsetY:0,width:200,height:150,scaleX:1,scaleY:1,defaultColor:0}}),id:"gm4",objects:[t({type:"rect",left:-100,top:-75,width:200,height:150,fill:"rgba(150,110,210,1)"}),t({type:"rect",left:-60,top:-40,width:90,height:90,fill:"rgba(250,220,120,1)"})]}]},q=()=>{let e=t=>({scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,...t});return[{...e({type:"image",left:60,top:50,src:d("../../assets/images/nasty_fabric.png")}),id:"cp0",clipPath:{type:"rect",left:40,top:30,width:100,height:120}},{...e({type:"rect",left:320,top:50,width:200,height:150,fill:"rgba(120,160,220,0.95)"}),id:"cp1",clipPath:{type:"ellipse",left:30,top:15,rx:70,ry:60}},{...e({type:"rect",left:600,top:50,width:220,height:150,fill:"rgba(230,150,90,0.95)"}),id:"cp2",clipPath:{type:"Path",left:20,top:10,path:"M 0 0 C 60 -30 140 30 180 0 C 160 80 80 130 0 110 Z"}},{...e({type:"rect",left:60,top:320,width:200,height:150,fill:"rgba(160,110,210,0.95)"}),id:"cp3",clipPath:{type:"ellipse",left:50,top:35,rx:50,ry:40,inverted:!0}},{...e({type:"rect",left:320,top:320,width:200,height:150,angle:15,fill:"rgba(100,200,150,0.95)"}),id:"cp4",clipPath:{type:"ellipse",left:350,top:340,rx:60,ry:50,absolutePositioned:!0}},{...e({type:"polygon",left:600,top:330,opacity:.7,fill:"rgba(40,40,80,0.9)",points:[{x:0,y:0},{x:220,y:20},{x:180,y:140},{x:20,y:130}]}),id:"cp5",clipPath:{type:"rect",left:10,top:10,width:120,height:70}}]},M=()=>{let e=t=>({scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,fontFamily:"sans-serif",lineHeight:1.16,...t});return[{...e({type:"ArchText",left:60,top:40,width:380,text:"拱形凸起",fontSize:48,fill:"rgba(40,60,140,0.95)",warpStrength:.6}),id:"wp0"},{...e({type:"ArchText",left:500,top:40,width:380,text:"凹陷下沉",fontSize:48,fill:"rgba(160,60,60,0.95)",warpStrength:-.5}),id:"wp1"},{...e({type:"WaistText",left:60,top:260,width:380,text:"腰线捏合",fontSize:48,fill:"rgba(40,130,90,0.95)",warpStrength:.7}),id:"wp2"},{...e({type:"WaistText",left:500,top:260,width:380,text:"腰线展开",fontSize:48,fill:"rgba(150,100,180,0.95)",warpStrength:-.6}),id:"wp3"},{...e({type:"FlagText",left:60,top:480,width:380,text:"波浪旗帜",fontSize:44,fill:"rgba(200,140,40,0.95)",warpStrength:.8}),id:"wp4"},{...e({type:"ArchText",left:500,top:470,width:400,angle:8,text:`旋转拱形多行
|
|
10
|
+
第二行文本`,fontSize:40,fill:"rgba(60,60,60,0.95)",warpStrength:.45}),id:"wp5"}]},A=()=>{let e=t=>({scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,fontFamily:"sans-serif",lineHeight:1.16,...t});return[{...e({type:"ArcText",left:60,top:50,text:"拱形弯曲文字",fontSize:44,fill:"rgba(30,90,150,0.95)",curvature:80}),id:"ac0"},{...e({type:"ArcText",left:480,top:40,text:"下垂弧形文字",fontSize:44,fill:"rgba(160,60,90,0.95)",curvature:-60}),id:"ac1"},{...e({type:"ArcText",left:60,top:250,text:`两行弧形
|
|
11
|
+
第二行也弯`,fontSize:34,fill:"rgba(50,120,70,0.95)",curvature:45}),id:"ac2"},{...e({type:"ArcText",left:480,top:240,text:`居中对齐弧形
|
|
12
|
+
次行短`,fontSize:30,fill:"rgba(120,80,160,0.95)",curvature:65,textAlign:"center"}),id:"ac3"},{...e({type:"CircleText",left:70,top:440,text:"圆形环绕文字",fontSize:30,fill:"rgba(180,110,30,0.95)",circleSize:85,circleSweep:360}),id:"ci0"},{...e({type:"CircleText",left:400,top:440,text:"部分弧段文本",fontSize:26,fill:"rgba(30,120,140,0.95)",circleSize:80,circleStartAngle:30,circleSweep:200,circleEccentricity:.4}),id:"ci1"},{...e({type:"CircleText",left:680,top:440,text:"水平字向环绕",fontSize:26,fill:"rgba(90,90,160,0.95)",circleSize:70,circleSweep:300,circleDirection:"horizontal"}),id:"ci2"}]},C=()=>{let e=t=>({type:"textbox",scaleX:1,scaleY:1,angle:90,originX:"center",originY:"center",opacity:1,strokeWidth:0,visible:!0,fontFamily:"sans-serif",lineHeight:1.16,textAlign:"left",vertical:!0,...t});return[{...e({left:170,top:280,width:340,text:`竖排文本渲染
|
|
13
|
+
引擎对拍内核`,fontSize:48,fill:"rgba(26,26,26,0.95)"}),id:"vt0"},{...e({left:400,top:300,width:440,text:"中文ABC 123混排",fontSize:44,fill:"rgba(30,80,150,0.95)",styles:{0:{0:{fontSize:64},6:{fill:"#c03030"},7:{fill:"#c03030"},8:{fill:"#c03030"}}}}),id:"vt1"},{...e({left:640,top:290,width:420,text:`「引号」标注。
|
|
14
|
+
、与〜省略…`,fontSize:44,fill:"rgba(120,60,140,0.95)"}),id:"vt2"},{...e({left:850,top:280,width:300,text:`居中对齐竖排
|
|
15
|
+
次列短`,fontSize:40,textAlign:"center",fill:"rgba(160,60,90,0.95)"}),id:"vt3"},{...e({left:1060,top:290,width:300,text:"右对齐带字距",fontSize:40,textAlign:"right",charSpacing:120,fill:"rgba(20,110,60,0.95)"}),id:"vt4"},{...e({left:170,top:700,width:300,text:`松列距竖排
|
|
16
|
+
第二列`,fontSize:40,lineHeight:1.8,fill:"rgba(40,40,40,0.95)"}),id:"vt5"},{...e({left:410,top:690,width:340,text:`装饰线与背景
|
|
17
|
+
高亮混排A`,fontSize:40,fill:"rgba(20,20,20,0.95)",underline:!0,textBackgroundColor:"#ffe08a",styles:{0:{5:{fill:"#2060c0"},6:{fill:"#2060c0"}}}}),id:"vt6"},{...e({left:690,top:680,width:320,text:"描边旋转斜置",fontSize:40,fill:"#2050a0",stroke:"#c03030",strokeWidth:1,angle:45}),id:"vt7"}]},Q=()=>{let e=t=>({type:"textbox",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,fontFamily:"sans-serif",lineHeight:1.16,textAlign:"left",fill:"rgba(26,26,26,0.95)",textOffsetY:300,...t});return[{...e({left:80,top:60,width:620,text:"隔字上下交错排列文本",fontSize:48,fill:"rgba(26,26,26,0.95)"}),id:"kl0"},{...e({left:820,top:60,width:560,text:"jitter stagger up",fontSize:42,textOffsetY:-240,fill:"#101010",styles:{0:{2:{fontSize:60,fill:"#c03030"},3:{fill:"#c03030"},9:{fill:"#2060c0"}}}}),id:"kl1"},{...e({left:80,top:220,width:620,text:`多行奇偶跨行
|
|
18
|
+
连续累计判定`,fontSize:40,textOffsetY:300,lineHeight:1.4,fill:"rgba(30,80,150,0.95)"}),id:"kl2"},{...e({left:820,top:220,width:560,text:"Latin ABC 123 spaced",fontSize:40,textOffsetY:180,charSpacing:60,fill:"rgba(20,110,60,0.95)"}),id:"kl3"},{...e({left:80,top:420,width:620,text:"描边旋转抖动链",fontSize:44,textOffsetY:240,fill:"#2050a0",stroke:"#c03030",strokeWidth:1,angle:15}),id:"kl4"},{...e({left:820,top:420,width:560,text:"dashed stroke jitter",fontSize:42,textOffsetY:300,fill:"#1a1a1a",stroke:"#2060c0",strokeWidth:1,strokeDashArray:[8,6]}),id:"kl5"},{...e({left:1440,top:80,width:360,text:`竖排抖动
|
|
19
|
+
锚点交错`,fontSize:40,vertical:!0,angle:90,originX:"center",originY:"center",textOffsetY:300,fill:"rgba(120,60,140,0.95)"}),id:"kl6"}]},J=()=>{let e="M51.3646 45.8642C49.7808 46.2782 47.906 46.705 45.8588 47.0857M45.8588 47.0857C34.1649 49.2607 16.8486 49.9343 16.0277 38.1484C15.22 26.5533 32.264 22.3636 45.6135 24.5626C53.601 25.8783 57.4507 29.6208 57.9285 34.237C58.2811 37.6435 55.778 43.3702 45.8588 47.0857ZM45.8588 47.0857C42.3367 48.4051 37.8795 49.4708 32.283 50.0891",t="M15 36L57 36",o="M4,2.6C4.4,1.1,5.8,0,7.4,0h0.3v21H3.5c-2.3,0-4-2.2-3.4-4.4L4,2.6z M7.4,0H60.3v21H7.4V0z M64,18.4c-0.4,1.5-1.8,2.6-3.4,2.6h-0.3V0h4.2c2.3,0,4,2.2,3.4,4.4L64,18.4z",i="M35 36.5 a11 11 0 1 0 -22 0 a11 11 0 1 0 22 0 Z M48 36.5 a11 11 0 1 0 -22 0 a11 11 0 1 0 22 0 Z M59 36.5 a11 11 0 1 0 -22 0 a11 11 0 1 0 22 0 Z",r="M26.147 47.719c.144-.04.295-.07.445-.052.282.029.529.215.811.273s.656-.14.584-.407c-.085-.302-.596-.267-.764-.54-.373-.616-1.112-.993-1.846-.993-.198 0-.396.029-.583.087a4 4 0 0 0-.613.261c-.83.407-1.714.924-2.014 1.777a2.4 2.4 0 0 0-.126.622 6.6 6.6 0 0 0 0 1.457c.132 1.11.679 2.306 1.773 2.672.349.116.728.14 1.094.116.896-.047 1.804-.337 2.441-.94.385-.367.674-.86.65-1.383-.018-.523-.415-1.04-.95-1.103-.626-.076-.638-1.11-1.239-1.295a.56.56 0 0 0-.62.22.54.54 0 0 0 .055.64c.223.243.192.632.018.91-.174.28-.457.471-.74.657-.222.151-.552.29-.733.087-.096-.104-.09-.261-.072-.4.18-1.243 1.172-2.335 2.423-2.666zm.998 3.258c.09-.21.114-.447.06-.668h.006a.8.8 0 0 0 .469-.151c-.06.4-.198.79-.39 1.144-.043.081-.187.023-.211-.064-.018-.087.03-.174.066-.261M23.375 50s.024.052.03.082c-.066.127 0 .278.012.423 0 .117-.096.244-.192.244a.13.13 0 0 1-.072-.029c-.06-.052-.048-.145-.03-.22q.08-.408.168-.825c0-.023.012-.052.024-.076.066-.098.24 0 .247.11 0 .117-.09.21-.18.291zm15.772-2.281c.144-.04.294-.07.445-.052.282.029.529.215.811.273s.656-.14.584-.407c-.085-.302-.596-.267-.764-.54-.373-.616-1.112-.993-1.846-.993a2 2 0 0 0-.583.087 4 4 0 0 0-.613.261c-.83.407-1.714.924-2.014 1.777a2.4 2.4 0 0 0-.126.622 6.6 6.6 0 0 0 0 1.457c.132 1.11.679 2.306 1.773 2.672.349.116.728.14 1.094.116.896-.047 1.804-.337 2.441-.94.385-.367.674-.86.65-1.383-.018-.523-.415-1.04-.95-1.103-.626-.076-.638-1.11-1.239-1.295a.56.56 0 0 0-.62.22.54.54 0 0 0 .055.64c.223.243.192.632.018.91-.174.28-.457.471-.74.657-.222.151-.553.29-.733.087-.096-.104-.09-.261-.072-.4.18-1.243 1.172-2.335 2.423-2.666z",l=(a,n={})=>({type:"svg",svgInfo:{path:a,stroke:"",fill:"",strokeWidth:3,isFill:!1,...n}}),s=a=>({type:"textbox",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,fontFamily:"sans-serif",lineHeight:1.16,textAlign:"left",fill:"rgba(26,26,26,0.95)",...a});return[{...s({left:80,top:60,width:620,text:"整段划线标记文本",fontSize:44,texts:[{text:"整段划线标记文本",highlight:l(t,{stroke:"#F96023",strokeWidth:6})}]}),id:"hl0"},{...s({left:820,top:60,width:560,text:"重点标记剩余部分",fontSize:44,texts:[{text:"重点标",highlight:l(e,{stroke:"#FFC300",strokeWidth:2.5})},{text:"记剩余部分"}]}),id:"hl1"},{...s({left:80,top:220,width:460,text:"背景填充高亮跨行自动换行分段渲染效果",fontSize:40,lineHeight:1.4,texts:[{text:"背景填充高亮跨行自动换行分段渲染效果",highlight:l(o,{fill:"pink",isFill:!0,strokeWidth:3})}]}),id:"hl2"},{...s({left:820,top:260,width:560,text:"dot mark per char",fontSize:40,charSpacing:40,texts:[{text:"dot mark per char",highlight:l(i,{fill:"#ff9cff",isFill:!0,isSingle:!0,scale:1.3})}]}),id:"hl3"},{...s({left:80,top:420,width:620,text:"hand written below",fontSize:44,texts:[{text:"hand written below",highlight:l(r,{fill:"#f95555",isFill:!0,isSingle:!0,scale:.3,alignVertical:"bottom"})}]}),id:"hl4"},{...s({left:820,top:420,width:560,text:`上行划线
|
|
20
|
+
下行圈圈`,fontSize:44,lineHeight:1.4,texts:[{text:"上行划线",highlight:l(t,{stroke:"#2060c0",strokeWidth:8})},{text:`
|
|
21
|
+
`},{text:"下行圈圈",highlight:l(e,{stroke:"#c03030",strokeWidth:2.5})}]}),id:"hl5"},{...s({left:80,top:620,width:620,text:"粗细重调旋转档",fontSize:42,angle:12,textAlign:"center",texts:[{text:"粗细重调旋转档",highlight:l(t,{stroke:"#746DFF",strokeWidth:10})}]}),id:"hl6"}]},K=()=>{let e=l=>({scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,fontFamily:"sans-serif",lineHeight:1.16,...l}),t=(l,s,a,n)=>({enabled:!0,showInDialog:!0,fill:l,blur:s,offsetX:a,offsetY:n}),o=l=>({enabled:!0,showInDialog:!0,fillType:0,fill:l}),i=(l,s,a)=>({enabled:!0,showInDialog:!0,fill:l,fillType:"color",size:{value:s},position:a}),r=l=>({stroke:[],solidFill:[],dropShadow:[],outerGlow:{enabled:!0,showInDialog:!0},gradientOverlay:[],...l});return[{...e({type:"ArcText",left:60,top:40,text:"弧形投影文字",fontSize:44,fill:"rgba(30,90,150,0.95)",curvature:70,effects:r({dropShadow:[t("rgba(200,40,40,0.55)",12,10,8)]})}),id:"afx0"},{...e({type:"ArcText",left:480,top:30,text:"下垂外描边",fontSize:44,fill:"rgba(160,60,90,0.95)",curvature:-60,effects:r({stroke:[i("#ff6600",6,"outside")]})}),id:"afx1"},{...e({type:"ArcText",left:60,top:250,text:"内描边弧形",fontSize:40,fill:"rgba(50,120,70,0.95)",curvature:50,effects:r({stroke:[i("#20c0a0",5,"inside")]})}),id:"afx2"},{...e({type:"ArcText",left:480,top:240,text:"填充居描双层",fontSize:40,fill:"rgba(120,80,160,0.95)",curvature:65,effects:r({solidFill:[o("rgba(255,220,80,0.9)")],stroke:[i("#8040c0",4,"center")]})}),id:"afx3"},{...e({type:"CircleText",left:60,top:450,text:"圆形环绕多层特效",fontSize:30,fill:"rgba(180,110,30,0.95)",circleSize:85,circleSweep:360,effects:r({dropShadow:[t("rgba(30,30,120,0.5)",10,8,8)],stroke:[i("#2050ff",4,"outside")]})}),id:"afx4"},{...e({type:"ArcText",left:420,top:440,text:"全特效叠加弧形",fontSize:36,fill:"rgba(30,120,140,0.95)",curvature:55,effects:r({dropShadow:[t("rgba(160,20,20,0.5)",10,7,7)],solidFill:[o("rgba(140,220,255,0.85)")],stroke:[i("#c02060",4,"outside")]})}),id:"afx5"}]},ee=()=>[{scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,fontFamily:"sans-serif",lineHeight:1.16,type:"ArcText",id:"alk0",left:60,top:60,text:"点击编辑标题",fontSize:24,fill:"#000000",curvature:55,effects:{stroke:[{enabled:!0,showInDialog:!0,fill:"#e2534d",fillType:"color",size:{value:4},position:"outside"},{enabled:!0,showInDialog:!0,fill:"#666666",fillType:"color",size:{value:8},position:"outside"}],solidFill:[],dropShadow:[],outerGlow:{enabled:!0,showInDialog:!0},gradientOverlay:[]}}],te=()=>{let e=o=>({type:"Table",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,...o}),t=(o,i,r)=>({row:o,col:i,fill:"#ffffff",stroke:"#d6d6d6",text:"",textFill:"#333333",fontSize:14,fontFamily:"sans-serif",fontWeight:"normal",fontStyle:"normal",textAlign:"center",...r});return[{...e({left:60,top:50,rows:3,cols:3,columnWidths:[120,120,120],minCellHeight:40,cellPadding:8,cellSpacing:0,cellStrokeWidth:1,cellFill:"#ffffff",cellStroke:"#d0d0d0",textFill:"#333333"}),id:"tb0",cellData:[t(0,0,{text:"名称"}),t(0,1,{text:"数量"}),t(0,2,{text:"单价"}),t(1,0,{text:"苹果"}),t(1,1,{text:"香蕉"}),t(1,2,{text:"葡萄"}),t(2,0,{text:"合计"}),t(2,1,{text:"十二"}),t(2,2,{text:"三十四",textFill:"#8a2b2b"})]},{...e({left:500,top:40,rows:2,cols:2,columnWidths:[130,130],minCellHeight:36,cellPadding:6,cellSpacing:0,cellStrokeWidth:1,cellFill:"#ffffff",cellStroke:"#c8c8c8",textFill:"#333333"}),id:"tb1",cellData:[t(0,0,{text:"A rather long latin sentence to wrap",fontSize:13,textAlign:"left"}),t(0,1,{text:"春夏秋冬循环往复四季更替",fontSize:13,textFill:"#1b4a8a"}),t(1,0,{text:"short"}),t(1,1,{text:"短句"})]},{...e({left:880,top:50,rows:3,cols:2,columnWidths:[110,110],manualRowHeights:[64,30,null],minCellHeight:40,cellPadding:8,cellSpacing:0,cellStrokeWidth:1,cellFill:"#ffffff",cellStroke:"#d0d0d0",textFill:"#333333"}),id:"tb2",cellData:[t(0,0,{text:"高行"}),t(0,1,{text:"手动"}),t(1,0,{text:"回涨",fontSize:14}),t(1,1,{text:"行"}),t(2,0,{text:"常规"})]},{...e({left:60,top:300,rows:2,cols:3,columnWidths:[100,100,100],minCellHeight:40,cellPadding:8,cellSpacing:0,cellStrokeWidth:1,cellFill:"#ffffff",cellStroke:"#d0d0d0",textFill:"#333333"}),id:"tb3",cellData:[t(0,0,{text:"跨两列的表头",colspan:2,fontSize:15,fontWeight:"bold",fill:"#f2f2f2"}),t(0,2,{text:"备注"}),t(1,0,{text:"甲"}),t(1,1,{}),t(1,2,{text:"丙"})]},{...e({left:500,top:300,rows:3,cols:2,columnWidths:[110,110],minCellHeight:40,cellPadding:8,cellSpacing:0,cellStrokeWidth:1,cellFill:"#ffffff",cellStroke:"#d0d0d0",textFill:"#333333"}),id:"tb4",cellData:[t(0,0,{text:"跨两行内容",rowspan:2,fill:"#eef7ee",stroke:"#6ba36b"}),t(0,1,{text:"右上"}),t(1,0,{isMerged:!0,mergeParent:{row:0,col:0}}),t(1,1,{text:"右中"}),t(2,0,{text:"左下"}),t(2,1,{text:"右下"})]},{...e({left:820,top:300,rows:3,cols:2,columnWidths:[130,130],minCellHeight:64,cellPadding:8,cellSpacing:0,cellStrokeWidth:1,cellFill:"#ffffff",cellStroke:"#d0d0d0",textFill:"#333333"}),id:"tb5",cellData:[t(0,0,{text:"顶部居左",verticalAlign:"top",textAlign:"left"}),t(0,1,{text:"底部居右",verticalAlign:"bottom",textAlign:"right",fontFamily:"serif",fontStyle:"italic",fontWeight:"bold",textFill:"#6a3fa0"}),t(1,0,{text:"垂直居中"}),t(1,1,{text:"顶部居右",verticalAlign:"top",textAlign:"right",fontWeight:"bold"}),t(2,0,{text:"底部居左",verticalAlign:"bottom",textAlign:"left",textFill:"#1b4a8a"}),t(2,1,{text:"默认档"})]},{...e({left:60,top:560,rows:2,cols:3,columnWidths:[90,150,120],minCellHeight:40,cellPadding:8,cellSpacing:2,cellStrokeWidth:1,cellFill:"#ffffff",cellStroke:"#d6d6d6",textFill:"#333333"}),id:"tb6",cellData:[t(0,0,{text:"甲",fill:"#e8f0fe",stroke:"#5b7fb9"}),t(0,1,{text:"宽列内容",fill:"#fdf0e8",stroke:"#b97a5b",textAlign:"left"}),t(0,2,{text:"丙"}),t(1,0,{text:"丁",fill:"#eef7ee",stroke:"#6ba36b"}),t(1,1,{text:"戊"}),t(1,2,{text:"己"})]},{...e({left:900,top:540,rows:2,cols:2,columnWidths:[120,100],minCellHeight:40,cellPadding:8,cellSpacing:1,cellStrokeWidth:1,cellFill:"#ffffff",cellStroke:"#c0c0c0",textFill:"#333333",angle:12,scaleX:1.1,scaleY:.92}),id:"tb7",cellData:[t(0,0,{text:"旋转表格"}),t(0,1,{text:"缩放",fill:"#fff7e8",stroke:"#c0a060"}),t(1,0,{text:"第二行"}),t(1,1,{text:"末格"})]}]},T=()=>{let e=d("../../assets/images/nasty_fabric.png"),t=d("../../assets/images/retina_wood.png"),o=d("../../assets/images/greyfloral.png"),i=d("../../assets/images/rotate.png"),r=d("../../assets/images/honey_im_subtle.png"),l=(f,c,h,u,p,g={})=>({type:"image",src:f,left:0,top:0,width:c,height:h,scaleX:Math.max(u/c,p/h),scaleY:Math.max(u/c,p/h),angle:0,flipX:!1,flipY:!1,opacity:1,originX:"left",originY:"top",crossOrigin:"anonymous",cropX:0,cropY:0,strokeWidth:0,visible:!0,...g}),s=(f,c,h,u,p,g,y,x)=>(y.filters=x,a(f,c,h,u,p,g,y)),a=(f,c,h,u,p,g,y,x={})=>({type:"Mask",id:f,left:c,top:h,width:u,height:p,originX:"center",originY:"center",scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,strokeWidth:0,visible:!0,src:e,crossOrigin:"anonymous",cropX:0,cropY:0,cornerRadius:g,innerRadius:12,outerRadius:0,seamlessMode:!1,seamlessNess:0,clipX:0,clipY:0,...y?{clipImage:y}:{},...x}),n=(f,c,h,u,p,g,y={})=>({type:"Puzzle",id:f,left:c,top:h,originX:"center",originY:"center",scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,strokeWidth:0,visible:!0,subTargetCheck:!0,interactive:!1,...g,layoutConfig:u,objects:p,...y});return[n("pz0",185,175,{rows:2,cols:2,pieces:[{id:1,row:0,col:0},{id:2,row:0,col:1},{id:3,row:1,col:0},{id:4,row:1,col:1}]},[a("pz0_m0",-77.5,-77.5,145,145,12,l(t,512,512,145,145)),a("pz0_m1",77.5,-77.5,145,145,12,l(o,150,124,145,145)),a("pz0_m2",-77.5,77.5,145,145,12,l(i,200,200,145,145)),a("pz0_m3",77.5,77.5,145,145,12,l(e,198,200,145,145))],{layoutWidth:300,layoutHeight:300,hGap:10,vGap:10,groupPadding:0,cornerRadius:12}),n("pz1",600,175,{rows:2,cols:3,pieces:[{id:1,row:0,col:0,colSpan:2},{id:2,row:0,col:2},{id:3,row:1,col:0},{id:4,row:1,col:1,colSpan:2}]},[a("pz1_m0",-56,-55.5,216,97,10,l(t,512,512,216,97)),a("pz1_m1",112,-55.5,104,97,10,null),a("pz1_m2",-112,55.5,104,97,10,l(r,179,132,104,97)),a("pz1_m3",56,55.5,216,97,10,l(o,150,124,216,97))],{layoutWidth:340,layoutHeight:220,hGap:8,vGap:14,groupPadding:6,cornerRadius:10}),n("pz2",990,175,{rows:1,cols:2,pieces:[{id:1,row:0,col:0},{id:2,row:0,col:1}]},[a("pz2_m0",-77.5,0,145,140,18,l(i,200,200,145,140,{angle:20,flipX:!0,scaleX:Math.max(145/200,140/200)*1.25,scaleY:Math.max(145/200,140/200)*1.25}),{clipX:12,clipY:-8}),a("pz2_m1",77.5,0,145,140,18,l(t,512,512,145,140,{angle:-30,clipX:-15,clipY:10}))],{layoutWidth:300,layoutHeight:140,hGap:10,vGap:10,groupPadding:0,cornerRadius:18}),n("pz3",215,510,{rows:2,cols:1,pieces:[{id:1,row:0,col:0},{id:2,row:1,col:0}]},[a("pz3_m0",0,-67.5,260,125,14,l(e,198,200,260,125)),a("pz3_m1",0,67.5,260,125,14,l(r,179,132,260,125))],{layoutWidth:260,layoutHeight:260,hGap:10,vGap:10,groupPadding:0,cornerRadius:14},{angle:25,scaleX:1.15,scaleY:1.15,opacity:.85}),n("pz4",600,520,{rows:1,cols:3,pieces:[{id:1,row:0,col:0},{id:2,row:0,col:1},{id:3,row:0,col:2}]},[a("pz4_m0",-50,20,60,40,8,l(i,200,200,60,40,{scaleX:.5,scaleY:.5})),a("pz4_m1",90,-10,70,50,8,l(o,150,124,70,50))],{layoutWidth:300,layoutHeight:150,hGap:12,vGap:12,groupPadding:0,cornerRadius:8}),a("pz5",990,520,200,150,20,l(o,150,124,200,150,{angle:10,flipY:!0})),{...a("pz6",820,360,200,140,16,l(t,512,512,200,140)),effects:{dropShadow:[{enabled:!0,showInDialog:!0,fill:"rgba(40,40,60,0.45)",blur:10,offsetX:8,offsetY:8}],solidFill:[{enabled:!0,showInDialog:!0,fillType:0,fill:"rgba(70,130,180,0.55)"}],stroke:[{enabled:!0,showInDialog:!0,fill:"rgba(200,60,60,1)",strokeWidth:5,strokeAlignment:"outside"},{enabled:!0,showInDialog:!0,fill:"rgba(60,60,200,1)",strokeWidth:12,strokeAlignment:"outside"}]}},{...a("pz7",1060,360,180,130,14,null),effects:{dropShadow:[{enabled:!0,showInDialog:!0,fill:"rgba(60,30,30,0.4)",blur:8,offsetX:-10,offsetY:6}],stroke:[{enabled:!0,showInDialog:!0,fill:"rgba(30,120,60,1)",strokeWidth:6,strokeAlignment:"center"}]}},s("pz8",820,530,200,140,16,l(t,512,512,200,140),[{type:"Grayscale"}]),s("pz8b",1060,530,180,130,12,l(r,179,132,180,130),[{type:"Brightness",psd:1,brightness:30}])]},ie=()=>{let e=d("../../assets/images/nasty_fabric.png"),t=d("../../assets/images/retina_wood.png"),o=d("../../assets/images/rotate.png"),i=(l,s,a,n,f,c={})=>({type:"image",src:l,left:0,top:0,width:s,height:a,scaleX:Math.max(n/s,f/a),scaleY:Math.max(n/s,f/a),angle:0,flipX:!1,flipY:!1,opacity:1,originX:"left",originY:"top",crossOrigin:"anonymous",cropX:0,cropY:0,strokeWidth:0,visible:!0,...c}),r=(l,s,a,n,f,c,h,u={})=>({type:"Mask",id:l,left:s,top:a,width:n,height:f,originX:"center",originY:"center",scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,strokeWidth:0,visible:!0,src:e,crossOrigin:"anonymous",cropX:0,cropY:0,cornerRadius:c,innerRadius:12,outerRadius:0,seamlessMode:!1,seamlessNess:0,clipX:0,clipY:0,clipImage:h,...u});return[r("mcp0",170,110,240,180,12,i(t,512,512,240,180,{scaleX:.7,scaleY:.7})),r("mcp1",600,150,200,150,0,i(o,200,200,200,150,{scaleX:1.4,scaleY:1.4}),{angle:12,scaleX:1.15,scaleY:1.15})]},le=(e,t)=>{let o=d("../../assets/images/nasty_fabric.png"),i=(r,l,s,a,n,f,c)=>({type:"Mask",id:r,left:l,top:s,width:a,height:n,originX:"center",originY:"center",scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,strokeWidth:0,visible:!0,src:o,crossOrigin:"anonymous",cropX:0,cropY:0,cornerRadius:f,clipX:0,clipY:0,clipImage:{left:0,top:0,originX:"left",originY:"top",crossOrigin:"anonymous",...c}});return[i("dm-gif",200,200,240,180,28,{type:"GIF",src:e,width:64,height:64,scaleX:3.75,scaleY:3.75}),i("dm-video",620,200,260,200,28,{type:"Video",src:t,width:368,height:244,scaleX:.8197,scaleY:.8197,loop:!0})]},oe=()=>{let e=t=>({scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,...t});return[e({type:"rect",id:"snA",left:100,top:100,width:120,height:80,fill:"rgba(154,165,177,0.95)"}),e({type:"rect",id:"snB",left:340,top:100,width:120,height:80,fill:"rgba(154,165,177,0.95)"}),e({type:"rect",id:"snRot",left:560,top:300,width:140,height:90,angle:30,fill:"rgba(240,180,90,0.95)"}),e({type:"textbox",id:"snTxt",left:160,top:320,width:240,text:"吸附参考文本",fontFamily:"sans-serif",fontSize:36,fill:"rgba(50,50,80,0.95)",lineHeight:1.16}),{...e({type:"Group",id:"snGrp",left:480,top:480,width:200,height:120,angle:-8}),objects:[e({type:"rect",left:-100,top:-60,width:100,height:120,fill:"rgba(110,170,210,0.95)"}),e({type:"rect",left:0,top:-60,width:100,height:120,fill:"rgba(210,140,190,0.95)"})]},e({type:"rect",id:"snT",left:700,top:100,width:100,height:60,fill:"rgba(47,111,237,0.95)"})]},re=e=>{let t=r=>({type:"textbox",scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,fontFamily:"sans-serif",lineHeight:1.16,textAlign:"left",fill:"rgba(26,26,26,0.95)",...r}),o={id:0,type:0,content:"1"},i=()=>({...t({left:80,top:60,width:520,text:`一一列表条目
|
|
22
|
+
二二列表条目
|
|
23
|
+
三三列表条目`,fontSize:44,paragraph:o}),id:"pp0"});return e==="ordered-only"?[i(),{...t({left:820,top:60,width:560,text:`宽前缀位移条目
|
|
24
|
+
第二行宽前缀
|
|
25
|
+
第三行宽前缀
|
|
26
|
+
第四行宽前缀`,fontSize:44,paragraph:{id:1,type:0,content:"●●●●"}}),id:"pp1w"}]:[i(),{...t({left:820,top:60,width:560,text:"无序符号条目",fontSize:44,paragraph:{id:1,type:0,content:"·"}}),id:"pp1"},{...t({left:80,top:250,width:430,text:"自动换行条目内容较长跨行后视觉行编号继续递增",fontSize:40,paragraph:o}),id:"pp2"},{...t({left:820,top:250,width:560,text:"行首字符样式前缀",fontSize:40,paragraph:o,styles:{0:{0:{fontSize:60,fill:"#F96023"}}}}),id:"pp3"},{...t({left:80,top:460,width:520,text:`居中对齐整体收边
|
|
27
|
+
第二行居中收边`,fontSize:40,textAlign:"center",paragraph:o}),id:"pp4"},{...t({left:820,top:460,width:560,text:"装饰线与前缀共存",fontSize:40,underline:!0,paragraph:o}),id:"pp5"},{...t({left:80,top:640,width:300,text:`竖排
|
|
28
|
+
编号条目`,fontSize:40,vertical:!0,paragraph:o}),id:"pp6"},{...t({left:820,top:640,width:560,text:"无前缀孪生锚文本",fontSize:44}),id:"pp7"}]},ae=()=>{let e=t=>({scaleX:1,scaleY:1,angle:0,originX:"left",originY:"top",opacity:1,strokeWidth:0,visible:!0,...t});return[e({type:"rect",id:"WorkSpaceDrawType",left:0,top:0,width:2e3,height:1400,fill:"#eef1f4"}),e({type:"FabricRect",id:"rr-fr",left:60,top:80,width:220,height:160,radius:40,fill:"#ef4444"}),e({type:"Rect",id:"rr-rect",left:340,top:80,width:220,height:160,rx:30,ry:14,fill:"#3b82f6"}),e({type:"image",id:"rr-img",left:620,top:80,width:220,height:160,rx:36,src:d("../../assets/images/retina_wood.png")}),{...e({type:"rect",id:"rr-clip",left:60,top:320,width:220,height:160,fill:"#eab308"}),clipPath:{type:"rect",left:-110,top:-80,width:220,height:160,rx:40}},e({type:"FabricRect",id:"rr-scale",left:340,top:320,width:220,height:160,radius:40,scaleX:1.5,scaleY:1,fill:"#8b5cf6"}),{...e({type:"polygon",id:"rr-poly",left:700,top:330,opacity:.7,fill:"rgba(40,40,80,0.9)",points:[{x:0,y:0},{x:120,y:12},{x:100,y:80},{x:12,y:74}]}),clipPath:{type:"rect",left:10,top:10,width:60,height:40}},e({type:"rect",id:"rr-sharp",left:620,top:320,width:220,height:160,fill:"#22c55e"})]};export{A as makeArcCircleTextScene,K as makeArcTextFxScene,ee as makeArcTextLeakScene,q as makeClipPathScene,k as makeCropImageScene,B as makeDashStrokeTextScene,W as makeDecorationTextScene,le as makeDynamicMaskScene,z as makeFilterImageScene,P as makeGradientScene,V as makeGroupMaskScene,N as makeGroupScene,U as makeImageAllScene,w as makeImageScene,Q as makeKlineTextScene,$ as makeLineScene,ie as makeMaskCropScene,_ as makePathEditScene,Z as makePathEffectsScene,O as makePathScene,L as makePatternScene,v as makePsdEffectsScene,T as makePuzzleScene,D as makeRectScene,ae as makeRoundedCornerScene,I as makeShadowScene,G as makeShapeScene,H as makeSmartObjectScene,oe as makeSnapScene,j as makeStrokeShapeScene,X as makeStrokeTextScene,R as makeSvgImageScene,te as makeTableScene,E as makeTextAllScene,F as makeTextFxScene,J as makeTextHighlightScene,re as makeTextParagraphScene,Y as makeTextScene,C as makeVerticalTextScene,M as makeWarpTextScene,b as mulberry32};
|