@yft-design/engine 0.0.0-stage → 0.0.1
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 +39 -2
- package/dist/EngineCanvas.d.ts +500 -0
- package/dist/EngineCanvas.js +927 -0
- package/dist/core/canvasPerf.d.ts +23 -0
- package/dist/core/canvasPerf.js +170 -0
- package/dist/core/color.d.ts +52 -0
- package/dist/core/color.js +107 -0
- package/dist/core/distanceField.d.ts +15 -0
- package/dist/core/distanceField.js +92 -0
- package/dist/core/events.d.ts +34 -0
- package/dist/core/events.js +52 -0
- package/dist/core/gradient.d.ts +97 -0
- package/dist/core/gradient.js +175 -0
- package/dist/core/imageFilters.d.ts +150 -0
- package/dist/core/imageFilters.js +330 -0
- package/dist/core/mat2d.d.ts +151 -0
- package/dist/core/mat2d.js +241 -0
- package/dist/core/pathData.d.ts +53 -0
- package/dist/core/pathData.js +926 -0
- package/dist/core/pattern.d.ts +38 -0
- package/dist/core/pattern.js +40 -0
- package/dist/core/point.d.ts +59 -0
- package/dist/core/point.js +119 -0
- package/dist/core/psdEffects.d.ts +126 -0
- package/dist/core/psdEffects.js +158 -0
- package/dist/core/roundedRect.d.ts +62 -0
- package/dist/core/roundedRect.js +163 -0
- package/dist/core/shadow.d.ts +51 -0
- package/dist/core/shadow.js +47 -0
- package/dist/core/snap.d.ts +232 -0
- package/dist/core/snap.js +793 -0
- package/dist/core/stroke.d.ts +41 -0
- package/dist/core/stroke.js +44 -0
- package/dist/core/triangulate.d.ts +24 -0
- package/dist/core/triangulate.js +118 -0
- package/dist/debug/canvasInspection.d.ts +92 -0
- package/dist/debug/canvasInspection.js +113 -0
- package/dist/debug/pixelDiff.d.ts +22 -0
- package/dist/debug/pixelDiff.js +64 -0
- package/dist/debug/seed.d.ts +473 -0
- package/dist/debug/seed.js +3803 -0
- package/dist/decoders/gif2sprite.d.ts +9 -0
- package/dist/decoders/gif2sprite.js +84 -0
- package/dist/decoders/webp2sprite.d.ts +22 -0
- package/dist/decoders/webp2sprite.js +133 -0
- package/dist/engineFlag.d.ts +72 -0
- package/dist/engineFlag.js +86 -0
- package/dist/export/SceneExporter.d.ts +92 -0
- package/dist/export/SceneExporter.js +280 -0
- package/dist/export/glExport.d.ts +66 -0
- package/dist/export/glExport.js +79 -0
- package/dist/export/svgExport.d.ts +277 -0
- package/dist/export/svgExport.js +1790 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +48 -0
- package/dist/interact/animationPlayback.d.ts +125 -0
- package/dist/interact/animationPlayback.js +344 -0
- package/dist/interact/canvasInteractions.d.ts +50 -0
- package/dist/interact/canvasInteractions.js +150 -0
- package/dist/interact/cropSession.d.ts +123 -0
- package/dist/interact/cropSession.js +526 -0
- package/dist/interact/dblClick.d.ts +51 -0
- package/dist/interact/dblClick.js +106 -0
- package/dist/interact/expandSession.d.ts +107 -0
- package/dist/interact/expandSession.js +281 -0
- package/dist/interact/hotkeyActions.d.ts +16 -0
- package/dist/interact/hotkeyActions.js +41 -0
- package/dist/interact/pathSession.d.ts +141 -0
- package/dist/interact/pathSession.js +480 -0
- package/dist/interact/pointer.d.ts +106 -0
- package/dist/interact/pointer.js +1594 -0
- package/dist/interact/pointerTablePuzzle.d.ts +100 -0
- package/dist/interact/pointerTablePuzzle.js +358 -0
- package/dist/interact/pointerTransform.d.ts +86 -0
- package/dist/interact/pointerTransform.js +440 -0
- package/dist/interact/pointerTypes.d.ts +577 -0
- package/dist/interact/pointerTypes.js +96 -0
- package/dist/interact/snapGuide.d.ts +127 -0
- package/dist/interact/snapGuide.js +376 -0
- package/dist/interact/tableCellEditing.d.ts +61 -0
- package/dist/interact/tableCellEditing.js +198 -0
- package/dist/interact/tableInteraction.d.ts +55 -0
- package/dist/interact/tableInteraction.js +212 -0
- package/dist/interact/textEditing.d.ts +77 -0
- package/dist/interact/textEditing.js +410 -0
- package/dist/interact/warpFacade.d.ts +36 -0
- package/dist/interact/warpFacade.js +51 -0
- package/dist/interact/warpSession.d.ts +191 -0
- package/dist/interact/warpSession.js +582 -0
- package/dist/interact/wheelScroll.d.ts +62 -0
- package/dist/interact/wheelScroll.js +72 -0
- package/dist/model/alphaHit.d.ts +59 -0
- package/dist/model/alphaHit.js +262 -0
- package/dist/model/animation.d.ts +228 -0
- package/dist/model/animation.js +510 -0
- package/dist/model/arcLayout.d.ts +54 -0
- package/dist/model/arcLayout.js +307 -0
- package/dist/model/arcTextTransform.d.ts +7 -0
- package/dist/model/arcTextTransform.js +87 -0
- package/dist/model/compatEvents.d.ts +135 -0
- package/dist/model/compatEvents.js +73 -0
- package/dist/model/compatObject.d.ts +716 -0
- package/dist/model/compatObject.js +1579 -0
- package/dist/model/cropEdit.d.ts +118 -0
- package/dist/model/cropEdit.js +497 -0
- package/dist/model/document.d.ts +294 -0
- package/dist/model/document.js +572 -0
- package/dist/model/expandEdit.d.ts +93 -0
- package/dist/model/expandEdit.js +161 -0
- package/dist/model/fabricPrimitives.d.ts +156 -0
- package/dist/model/fabricPrimitives.js +9 -0
- package/dist/model/filler.d.ts +53 -0
- package/dist/model/filler.js +1 -0
- package/dist/model/groupAssemble.d.ts +7 -0
- package/dist/model/groupAssemble.js +98 -0
- package/dist/model/groupChildMove.d.ts +46 -0
- package/dist/model/groupChildMove.js +145 -0
- package/dist/model/groupResize.d.ts +78 -0
- package/dist/model/groupResize.js +108 -0
- package/dist/model/handles.d.ts +40 -0
- package/dist/model/handles.js +29 -0
- package/dist/model/imageMaskBake.d.ts +75 -0
- package/dist/model/imageMaskBake.js +136 -0
- package/dist/model/lineConstruct.d.ts +13 -0
- package/dist/model/lineConstruct.js +79 -0
- package/dist/model/maskCropEdit.d.ts +64 -0
- package/dist/model/maskCropEdit.js +90 -0
- package/dist/model/pathBackground.d.ts +51 -0
- package/dist/model/pathBackground.js +196 -0
- package/dist/model/pathConstruct.d.ts +27 -0
- package/dist/model/pathConstruct.js +55 -0
- package/dist/model/pathEdit.d.ts +114 -0
- package/dist/model/pathEdit.js +378 -0
- package/dist/model/puzzleEdit.d.ts +136 -0
- package/dist/model/puzzleEdit.js +742 -0
- package/dist/model/puzzleLayout.d.ts +91 -0
- package/dist/model/puzzleLayout.js +143 -0
- package/dist/model/scene.d.ts +1004 -0
- package/dist/model/scene.js +2841 -0
- package/dist/model/schema.d.ts +290 -0
- package/dist/model/schema.js +13 -0
- package/dist/model/shapePath.d.ts +14 -0
- package/dist/model/shapePath.js +136 -0
- package/dist/model/tableEdit.d.ts +196 -0
- package/dist/model/tableEdit.js +751 -0
- package/dist/model/tableFacade.d.ts +6 -0
- package/dist/model/tableFacade.js +808 -0
- package/dist/model/tableLayout.d.ts +85 -0
- package/dist/model/tableLayout.js +193 -0
- package/dist/model/textLayout.d.ts +357 -0
- package/dist/model/textLayout.js +822 -0
- package/dist/render/GLBlend.d.ts +40 -0
- package/dist/render/GLBlend.js +270 -0
- package/dist/render/GLContext.d.ts +25 -0
- package/dist/render/GLContext.js +48 -0
- package/dist/render/GLIsolate.d.ts +46 -0
- package/dist/render/GLIsolate.js +188 -0
- package/dist/render/GLTextureCache.d.ts +86 -0
- package/dist/render/GLTextureCache.js +187 -0
- package/dist/render/GlyphAtlas.d.ts +151 -0
- package/dist/render/GlyphAtlas.js +404 -0
- package/dist/render/MeshBatch.d.ts +123 -0
- package/dist/render/MeshBatch.js +416 -0
- package/dist/render/QuadBatch.d.ts +138 -0
- package/dist/render/QuadBatch.js +490 -0
- package/dist/render/SceneRenderer.d.ts +186 -0
- package/dist/render/SceneRenderer.js +700 -0
- package/dist/render/SourceManager.d.ts +121 -0
- package/dist/render/SourceManager.js +505 -0
- package/dist/render/TextRenderer.d.ts +140 -0
- package/dist/render/TextRenderer.js +795 -0
- package/dist/render/arcText.d.ts +40 -0
- package/dist/render/arcText.js +187 -0
- package/dist/render/batchOrder.d.ts +105 -0
- package/dist/render/batchOrder.js +168 -0
- package/dist/render/blendMode.d.ts +35 -0
- package/dist/render/blendMode.js +142 -0
- package/dist/render/clipMaskPainter.d.ts +17 -0
- package/dist/render/clipMaskPainter.js +121 -0
- package/dist/render/fontInvalidation.d.ts +25 -0
- package/dist/render/fontInvalidation.js +77 -0
- package/dist/render/fontInvalidationController.d.ts +76 -0
- package/dist/render/fontInvalidationController.js +114 -0
- package/dist/render/frameOverlay.d.ts +62 -0
- package/dist/render/frameOverlay.js +124 -0
- package/dist/render/framePipeline.d.ts +99 -0
- package/dist/render/framePipeline.js +95 -0
- package/dist/render/gpuFilterPasses.d.ts +25 -0
- package/dist/render/gpuFilterPasses.js +883 -0
- package/dist/render/gpuFx.d.ts +136 -0
- package/dist/render/gpuFx.js +614 -0
- package/dist/render/gpuImageFilters.d.ts +59 -0
- package/dist/render/gpuImageFilters.js +289 -0
- package/dist/render/gpuShadow.d.ts +52 -0
- package/dist/render/gpuShadow.js +289 -0
- package/dist/render/gradientRamp.d.ts +45 -0
- package/dist/render/gradientRamp.js +74 -0
- package/dist/render/imageEffects.d.ts +123 -0
- package/dist/render/imageEffects.js +390 -0
- package/dist/render/maskRender.d.ts +92 -0
- package/dist/render/maskRender.js +224 -0
- package/dist/render/progressiveLoad.d.ts +45 -0
- package/dist/render/progressiveLoad.js +86 -0
- package/dist/render/psdEffectPainter.d.ts +34 -0
- package/dist/render/psdEffectPainter.js +309 -0
- package/dist/render/puzzleClamp.d.ts +28 -0
- package/dist/render/puzzleClamp.js +30 -0
- package/dist/render/retainedFrame.d.ts +85 -0
- package/dist/render/retainedFrame.js +193 -0
- package/dist/render/ruler.d.ts +90 -0
- package/dist/render/ruler.js +287 -0
- package/dist/render/scrollText.d.ts +65 -0
- package/dist/render/scrollText.js +261 -0
- package/dist/render/selectionOverlay.d.ts +318 -0
- package/dist/render/selectionOverlay.js +921 -0
- package/dist/render/shaders.d.ts +38 -0
- package/dist/render/shaders.js +314 -0
- package/dist/render/shadowBake.d.ts +43 -0
- package/dist/render/shadowBake.js +202 -0
- package/dist/render/shadowPainter.d.ts +13 -0
- package/dist/render/shadowPainter.js +80 -0
- package/dist/render/sharedGpuPainters.d.ts +25 -0
- package/dist/render/sharedGpuPainters.js +40 -0
- package/dist/render/sourceHydration.d.ts +12 -0
- package/dist/render/sourceHydration.js +48 -0
- package/dist/render/strokeBake.d.ts +85 -0
- package/dist/render/strokeBake.js +515 -0
- package/dist/render/strokePainter.d.ts +28 -0
- package/dist/render/strokePainter.js +119 -0
- package/dist/render/strokeSdf.d.ts +35 -0
- package/dist/render/strokeSdf.js +74 -0
- package/dist/render/svgRaster.d.ts +46 -0
- package/dist/render/svgRaster.js +71 -0
- package/dist/render/tableOverlay.d.ts +38 -0
- package/dist/render/tableOverlay.js +233 -0
- package/dist/render/textHighlight.d.ts +117 -0
- package/dist/render/textHighlight.js +380 -0
- package/dist/render/textureUpload.d.ts +18 -0
- package/dist/render/textureUpload.js +26 -0
- package/dist/render/verticalText.d.ts +38 -0
- package/dist/render/verticalText.js +63 -0
- package/dist/render/warpText.d.ts +58 -0
- package/dist/render/warpText.js +380 -0
- package/dist/render/workspaceBackdrop.d.ts +35 -0
- package/dist/render/workspaceBackdrop.js +71 -0
- package/dist/render/workspaceChecker.d.ts +54 -0
- package/dist/render/workspaceChecker.js +170 -0
- package/dist/render/workspaceGlow.d.ts +51 -0
- package/dist/render/workspaceGlow.js +171 -0
- package/package.json +39 -3
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 画布标尺(P5-3 子片)——应用 FabricRuler(src/app/fabricRuler.ts)的引擎侧复刻。
|
|
3
|
+
*
|
|
4
|
+
* 视觉口径逐项同源:20px 边带(上=水平/左=垂直)、zoom→gap 分档表、主刻度带数值
|
|
5
|
+
* /副刻度 gap/10、工作区场景矩形裁剪(只画画板区段)、选区包围盒投影到边带的
|
|
6
|
+
* 蓝色高亮(同轴合并)、左上角单位方块('px')、垂直标尺数字 -90° 旋转。
|
|
7
|
+
* 线条浓度口径(批次 90 像素对拍勘正):fabric 刻度=darwLine 0.6px canvas2d AA
|
|
8
|
+
* 淡线、边带无外框线/角块描边 0.05px 不可见——引擎以 1px quad×alpha0.6 等价
|
|
9
|
+
* 刻度墨量、不画任何边框线(GL 亚像素 quad 有整条丢弃风险,宽度不缩、降浓度)。
|
|
10
|
+
*
|
|
11
|
+
* 渲染形态:OverlayQuad(场景空间矩阵 + px/zoom 恒定屏幕尺寸——selectionOverlay
|
|
12
|
+
* 同约定),由 EngineCanvas.render 覆盖层段消费。**数字不走逐帧 fillText**:
|
|
13
|
+
* 每个数值用 2D canvas 栅格化一次进模块级位图缓存(3× 超采样),quad 以缓存
|
|
14
|
+
* 画布为贴图经 GLTextureCache 上传(纹理可被 LRU 逐出,源画布常驻重传即回)。
|
|
15
|
+
*
|
|
16
|
+
* 刻度规划(rulerGap/planRulerTicks)为纯函数——jsdom 单测锁死分档/范围/裁剪。
|
|
17
|
+
*/
|
|
18
|
+
import { type RGBA } from '../core/color';
|
|
19
|
+
import type { Mat } from '../core/mat2d';
|
|
20
|
+
import type { OverlayQuad } from './selectionOverlay';
|
|
21
|
+
export interface RulerStyle {
|
|
22
|
+
ruleSize: number;
|
|
23
|
+
backgroundColor: RGBA;
|
|
24
|
+
tickColor: RGBA;
|
|
25
|
+
textColor: string;
|
|
26
|
+
highlightColor: RGBA;
|
|
27
|
+
/** 数值字号(CSS px) */
|
|
28
|
+
fontSize: number;
|
|
29
|
+
unitName: string;
|
|
30
|
+
}
|
|
31
|
+
/** 标尺带宽(CSS px)——渲染与 pointer 带命中/参考线拖出的单一来源 */
|
|
32
|
+
export declare const RULER_SIZE = 20;
|
|
33
|
+
export declare const rulerGap: (zoom: number) => number;
|
|
34
|
+
export interface RulerTickPlan {
|
|
35
|
+
/** 主刻度场景值(带数值) */
|
|
36
|
+
majors: number[];
|
|
37
|
+
/** 副刻度场景值(gap/10,不含主刻度位置) */
|
|
38
|
+
minors: number[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 刻度规划:startScene = 视口 0 位对应的场景坐标,visibleScene = 视口全长(场景单位),
|
|
42
|
+
* clip = 工作区场景区间(null = 全幅)。主刻度从 ≤startScene 的第一个 gap 整数倍起。
|
|
43
|
+
*/
|
|
44
|
+
export declare const planRulerTicks: (startScene: number, visibleScene: number, clip: [number, number] | null, zoom: number) => RulerTickPlan;
|
|
45
|
+
/** 同轴合并(应用 mergeLines 同算法):把选区包围盒按带宽轴合并成不连续段 */
|
|
46
|
+
export declare const mergeHighlightSpans: (rects: Array<{
|
|
47
|
+
left: number;
|
|
48
|
+
top: number;
|
|
49
|
+
width: number;
|
|
50
|
+
height: number;
|
|
51
|
+
}>, horizontal: boolean) => Array<{
|
|
52
|
+
start: number;
|
|
53
|
+
length: number;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const rulerDigitCanvas: (text: string, style?: RulerStyle) => HTMLCanvasElement;
|
|
56
|
+
export declare const referenceBadgeCanvas: (text: string) => HTMLCanvasElement;
|
|
57
|
+
export interface RulerOverlayInput {
|
|
58
|
+
vpt: Mat;
|
|
59
|
+
cssWidth: number;
|
|
60
|
+
cssHeight: number;
|
|
61
|
+
/** 工作区场景矩形(null = 全幅标尺) */
|
|
62
|
+
workspaceRect: {
|
|
63
|
+
left: number;
|
|
64
|
+
top: number;
|
|
65
|
+
width: number;
|
|
66
|
+
height: number;
|
|
67
|
+
} | null;
|
|
68
|
+
/** 选区包围盒(场景系;投影到边带做高亮,同轴合并) */
|
|
69
|
+
selectionRects: Array<{
|
|
70
|
+
left: number;
|
|
71
|
+
top: number;
|
|
72
|
+
width: number;
|
|
73
|
+
height: number;
|
|
74
|
+
}>;
|
|
75
|
+
/** 数字位图源(测试可注入;缺省模块缓存) */
|
|
76
|
+
digitCanvas?: (text: string) => HTMLCanvasElement;
|
|
77
|
+
/** 参考线拖拽态(批次 72):非 null 时在边带画线位数值气泡(fabric
|
|
78
|
+
* drawReferenceLineValue 同构——横线气泡贴左带、竖线贴上带,出画布钳边) */
|
|
79
|
+
referenceLine?: {
|
|
80
|
+
axis: 'horizontal' | 'vertical';
|
|
81
|
+
position: number;
|
|
82
|
+
} | null;
|
|
83
|
+
style?: Partial<RulerStyle>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* 标尺覆盖层:上边带(水平)+ 左边带(垂直)+ 角块。
|
|
87
|
+
* quads 为场景空间矩阵(batch 已带场景视图)——屏幕 px 位置经 vpt 逆变换落场景,
|
|
88
|
+
* 尺寸按 px/zoom 保持屏幕恒定(selectionOverlay 同约定)。
|
|
89
|
+
*/
|
|
90
|
+
export declare const buildRulerOverlay: (input: RulerOverlayInput) => OverlayQuad[];
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 画布标尺(P5-3 子片)——应用 FabricRuler(src/app/fabricRuler.ts)的引擎侧复刻。
|
|
3
|
+
*
|
|
4
|
+
* 视觉口径逐项同源:20px 边带(上=水平/左=垂直)、zoom→gap 分档表、主刻度带数值
|
|
5
|
+
* /副刻度 gap/10、工作区场景矩形裁剪(只画画板区段)、选区包围盒投影到边带的
|
|
6
|
+
* 蓝色高亮(同轴合并)、左上角单位方块('px')、垂直标尺数字 -90° 旋转。
|
|
7
|
+
* 线条浓度口径(批次 90 像素对拍勘正):fabric 刻度=darwLine 0.6px canvas2d AA
|
|
8
|
+
* 淡线、边带无外框线/角块描边 0.05px 不可见——引擎以 1px quad×alpha0.6 等价
|
|
9
|
+
* 刻度墨量、不画任何边框线(GL 亚像素 quad 有整条丢弃风险,宽度不缩、降浓度)。
|
|
10
|
+
*
|
|
11
|
+
* 渲染形态:OverlayQuad(场景空间矩阵 + px/zoom 恒定屏幕尺寸——selectionOverlay
|
|
12
|
+
* 同约定),由 EngineCanvas.render 覆盖层段消费。**数字不走逐帧 fillText**:
|
|
13
|
+
* 每个数值用 2D canvas 栅格化一次进模块级位图缓存(3× 超采样),quad 以缓存
|
|
14
|
+
* 画布为贴图经 GLTextureCache 上传(纹理可被 LRU 逐出,源画布常驻重传即回)。
|
|
15
|
+
*
|
|
16
|
+
* 刻度规划(rulerGap/planRulerTicks)为纯函数——jsdom 单测锁死分档/范围/裁剪。
|
|
17
|
+
*/
|
|
18
|
+
import { parseColor } from '../core/color';
|
|
19
|
+
/** 标尺带宽(CSS px)——渲染与 pointer 带命中/参考线拖出的单一来源 */
|
|
20
|
+
export const RULER_SIZE = 20;
|
|
21
|
+
const DEFAULT_STYLE = {
|
|
22
|
+
ruleSize: RULER_SIZE,
|
|
23
|
+
backgroundColor: parseColor('#ffffff'),
|
|
24
|
+
tickColor: parseColor('#A1A7AF'),
|
|
25
|
+
textColor: '#444444',
|
|
26
|
+
highlightColor: parseColor('#165dff3b'),
|
|
27
|
+
fontSize: 8,
|
|
28
|
+
unitName: 'px'
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* 刻度线浓度(批次 90):fabric darwLine 硬编码 lineWidth=0.6 CSS px,canvas2d AA
|
|
32
|
+
* 下单行有效墨量 ≈0.6 列;GL 1px quad 不能靠缩宽度还原(亚像素 quad 盖不到像素
|
|
33
|
+
* 中心整条被丢弃——参考线批次 72 教训),以 alpha 0.6 等价(1px×0.6 ≈ 0.6px AA
|
|
34
|
+
* 线墨量;像素对拍 fabric 实测 ~0.62 列 vs 修复前引擎 ~1.15 列)。
|
|
35
|
+
*/
|
|
36
|
+
const TICK_ALPHA = 0.6;
|
|
37
|
+
/** 数字位图超采样倍数(8px 字号按 24px 栅格化,quad 缩回——低分屏仍锐利) */
|
|
38
|
+
const DIGIT_SUPERSAMPLE = 3;
|
|
39
|
+
const DIGIT_FONT = `'Arial Narrow', 'Segoe UI', sans-serif`;
|
|
40
|
+
/** zoom→主刻度间距分档(应用 FabricRuler.getGap 同表) */
|
|
41
|
+
const GAP_ZOOMS = [0.02, 0.03, 0.05, 0.1, 0.2, 0.5, 1, 2, 5];
|
|
42
|
+
const GAP_STEPS = [5000, 2500, 1000, 500, 200, 100, 50, 20, 10];
|
|
43
|
+
export const rulerGap = (zoom) => {
|
|
44
|
+
let i = 0;
|
|
45
|
+
while (i < GAP_ZOOMS.length && GAP_ZOOMS[i] < zoom)
|
|
46
|
+
i++;
|
|
47
|
+
return GAP_STEPS[i - 1] ?? 10000;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* 刻度规划:startScene = 视口 0 位对应的场景坐标,visibleScene = 视口全长(场景单位),
|
|
51
|
+
* clip = 工作区场景区间(null = 全幅)。主刻度从 ≤startScene 的第一个 gap 整数倍起。
|
|
52
|
+
*/
|
|
53
|
+
export const planRulerTicks = (startScene, visibleScene, clip, zoom) => {
|
|
54
|
+
const gap = rulerGap(zoom);
|
|
55
|
+
const first = Math.floor(startScene / gap) * gap;
|
|
56
|
+
const last = startScene + visibleScene;
|
|
57
|
+
const majors = [];
|
|
58
|
+
const minors = [];
|
|
59
|
+
const inRange = (v) => v >= startScene - 1e-6 && v <= last + 1e-6 && (!clip || (v >= clip[0] - 1e-6 && v <= clip[1] + 1e-6));
|
|
60
|
+
for (let v = first; v <= last + gap; v += gap) {
|
|
61
|
+
if (inRange(v))
|
|
62
|
+
majors.push(v);
|
|
63
|
+
for (let i = 1; i < 10; i++) {
|
|
64
|
+
const m = v + (gap * i) / 10;
|
|
65
|
+
if (m > last + gap)
|
|
66
|
+
break;
|
|
67
|
+
if (inRange(m))
|
|
68
|
+
minors.push(m);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return { majors, minors };
|
|
72
|
+
};
|
|
73
|
+
/** 同轴合并(应用 mergeLines 同算法):把选区包围盒按带宽轴合并成不连续段 */
|
|
74
|
+
export const mergeHighlightSpans = (rects, horizontal) => {
|
|
75
|
+
if (!rects.length)
|
|
76
|
+
return [];
|
|
77
|
+
const axis = horizontal ? 'left' : 'top';
|
|
78
|
+
const len = horizontal ? 'width' : 'height';
|
|
79
|
+
const sorted = [...rects].sort((a, b) => a[axis] - b[axis]);
|
|
80
|
+
const spans = [];
|
|
81
|
+
let cur = { start: sorted[0][axis], length: sorted[0][len] };
|
|
82
|
+
for (let i = 1; i < sorted.length; i++) {
|
|
83
|
+
const r = sorted[i];
|
|
84
|
+
if (cur.start + cur.length >= r[axis]) {
|
|
85
|
+
cur.length = Math.max(cur.start + cur.length, r[axis] + r[len]) - cur.start;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
spans.push(cur);
|
|
89
|
+
cur = { start: r[axis], length: r[len] };
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
spans.push(cur);
|
|
93
|
+
return spans;
|
|
94
|
+
};
|
|
95
|
+
/** 数字位图缓存:每文本栅格化一次(模块级——标尺数值集合有限,长会话有界) */
|
|
96
|
+
const digitBitmapCache = new Map();
|
|
97
|
+
export const rulerDigitCanvas = (text, style = DEFAULT_STYLE) => {
|
|
98
|
+
const cached = digitBitmapCache.get(text);
|
|
99
|
+
if (cached)
|
|
100
|
+
return cached;
|
|
101
|
+
const canvas = document.createElement('canvas');
|
|
102
|
+
const ctx = canvas.getContext('2d');
|
|
103
|
+
if (!ctx) {
|
|
104
|
+
// jsdom 等无 2d 环境:占位画布(尺寸按字符宽估算,消费方仅取 width/height)
|
|
105
|
+
canvas.width = Math.max(1, Math.round(text.length * style.fontSize * 0.6 * DIGIT_SUPERSAMPLE));
|
|
106
|
+
canvas.height = Math.max(1, Math.round(style.fontSize * 1.4 * DIGIT_SUPERSAMPLE));
|
|
107
|
+
digitBitmapCache.set(text, canvas);
|
|
108
|
+
return canvas;
|
|
109
|
+
}
|
|
110
|
+
const font = `${style.fontSize * DIGIT_SUPERSAMPLE}px ${DIGIT_FONT}`;
|
|
111
|
+
ctx.font = font;
|
|
112
|
+
const metrics = ctx.measureText(text);
|
|
113
|
+
canvas.width = Math.max(1, Math.ceil(metrics.width) + 2);
|
|
114
|
+
canvas.height = Math.ceil(style.fontSize * DIGIT_SUPERSAMPLE * 1.25);
|
|
115
|
+
// 尺寸重置后 font 复位,重设再画
|
|
116
|
+
ctx.font = font;
|
|
117
|
+
ctx.textBaseline = 'top';
|
|
118
|
+
ctx.fillStyle = style.textColor;
|
|
119
|
+
ctx.fillText(text, 1, Math.round(style.fontSize * DIGIT_SUPERSAMPLE * 0.15));
|
|
120
|
+
digitBitmapCache.set(text, canvas);
|
|
121
|
+
return canvas;
|
|
122
|
+
};
|
|
123
|
+
/** 参考线数值气泡位图(批次 72;app FabricRuler.drawReferenceLineValue 同构):
|
|
124
|
+
* 蓝底圆角 + 白字 10px,pad 4、r 3,3× 超采样,按文本串缓存 */
|
|
125
|
+
const badgeCache = new Map();
|
|
126
|
+
const BADGE_FONT_SIZE = 10;
|
|
127
|
+
const BADGE_PADDING = 4;
|
|
128
|
+
export const referenceBadgeCanvas = (text) => {
|
|
129
|
+
const cached = badgeCache.get(text);
|
|
130
|
+
if (cached)
|
|
131
|
+
return cached;
|
|
132
|
+
const fontSize = BADGE_FONT_SIZE * DIGIT_SUPERSAMPLE;
|
|
133
|
+
const pad = BADGE_PADDING * DIGIT_SUPERSAMPLE;
|
|
134
|
+
const canvas = document.createElement('canvas');
|
|
135
|
+
const ctx = canvas.getContext('2d');
|
|
136
|
+
if (!ctx) {
|
|
137
|
+
// jsdom 无 2d:占位尺寸(消费方仅取 width/height)
|
|
138
|
+
canvas.width = Math.max(1, Math.round((text.length * BADGE_FONT_SIZE * 0.6 + BADGE_PADDING * 2) * DIGIT_SUPERSAMPLE));
|
|
139
|
+
canvas.height = Math.max(1, Math.round((BADGE_FONT_SIZE + BADGE_PADDING * 2) * DIGIT_SUPERSAMPLE));
|
|
140
|
+
badgeCache.set(text, canvas);
|
|
141
|
+
return canvas;
|
|
142
|
+
}
|
|
143
|
+
const font = `${fontSize}px ${DIGIT_FONT}`;
|
|
144
|
+
ctx.font = font;
|
|
145
|
+
const textW = ctx.measureText(text).width;
|
|
146
|
+
const radius = 3 * DIGIT_SUPERSAMPLE;
|
|
147
|
+
canvas.width = Math.max(1, Math.ceil(textW) + pad * 2);
|
|
148
|
+
canvas.height = Math.ceil((BADGE_FONT_SIZE + BADGE_PADDING * 2) * DIGIT_SUPERSAMPLE);
|
|
149
|
+
// 尺寸重置后 font 复位,重设再画
|
|
150
|
+
ctx.font = font;
|
|
151
|
+
// 圆角矩形(app 手绘 quad 曲线同形)
|
|
152
|
+
ctx.beginPath();
|
|
153
|
+
ctx.moveTo(radius, 0);
|
|
154
|
+
ctx.lineTo(canvas.width - radius, 0);
|
|
155
|
+
ctx.quadraticCurveTo(canvas.width, 0, canvas.width, radius);
|
|
156
|
+
ctx.lineTo(canvas.width, canvas.height - radius);
|
|
157
|
+
ctx.quadraticCurveTo(canvas.width, canvas.height, canvas.width - radius, canvas.height);
|
|
158
|
+
ctx.lineTo(radius, canvas.height);
|
|
159
|
+
ctx.quadraticCurveTo(0, canvas.height, 0, canvas.height - radius);
|
|
160
|
+
ctx.lineTo(0, radius);
|
|
161
|
+
ctx.quadraticCurveTo(0, 0, radius, 0);
|
|
162
|
+
ctx.closePath();
|
|
163
|
+
ctx.fillStyle = 'rgba(22, 93, 255, 0.9)';
|
|
164
|
+
ctx.fill();
|
|
165
|
+
ctx.strokeStyle = '#fff';
|
|
166
|
+
ctx.lineWidth = 0.5 * DIGIT_SUPERSAMPLE;
|
|
167
|
+
ctx.stroke();
|
|
168
|
+
ctx.fillStyle = '#fff';
|
|
169
|
+
ctx.textBaseline = 'top';
|
|
170
|
+
ctx.fillText(text, pad, pad);
|
|
171
|
+
badgeCache.set(text, canvas);
|
|
172
|
+
return canvas;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* 标尺覆盖层:上边带(水平)+ 左边带(垂直)+ 角块。
|
|
176
|
+
* quads 为场景空间矩阵(batch 已带场景视图)——屏幕 px 位置经 vpt 逆变换落场景,
|
|
177
|
+
* 尺寸按 px/zoom 保持屏幕恒定(selectionOverlay 同约定)。
|
|
178
|
+
*/
|
|
179
|
+
export const buildRulerOverlay = (input) => {
|
|
180
|
+
const style = { ...DEFAULT_STYLE, ...input.style };
|
|
181
|
+
const { vpt, cssWidth, cssHeight } = input;
|
|
182
|
+
const zoom = vpt[0];
|
|
183
|
+
const digit = input.digitCanvas ?? ((text) => rulerDigitCanvas(text, style));
|
|
184
|
+
const quads = [];
|
|
185
|
+
// 屏幕 css px → 场景(vpt 逆)
|
|
186
|
+
const sx = (cssX) => (cssX - vpt[4]) / zoom;
|
|
187
|
+
const sy = (cssY) => (cssY - vpt[5]) / zoom;
|
|
188
|
+
const s = 1 / zoom;
|
|
189
|
+
// 批次 70:OverlayQuad 平移=quad 中心(selectionOverlay lineQuad/squareQuad 同约定,
|
|
190
|
+
// 着色器 (corner-0.5)*dim 中心系顶点)——rect 按「左上角+半宽高」落中心、digitQuad
|
|
191
|
+
// 按字形锚换算。修复前 rect 直把左上角塞进平移:顶带白底左移半幅(右半露出
|
|
192
|
+
// 工作区灰遮罩)、左带白底上移半幅(下半段灰底),低缩放下大面积暴露。
|
|
193
|
+
const rect = (left, top, w, h, color) => ({
|
|
194
|
+
matrix: [s, 0, 0, s, sx(left + w / 2), sy(top + h / 2)],
|
|
195
|
+
dims: { x: w, y: h },
|
|
196
|
+
color
|
|
197
|
+
});
|
|
198
|
+
const digitQuad = (text, anchorX, anchorY, rotate90 = false) => {
|
|
199
|
+
const canvas = digit(text);
|
|
200
|
+
const w = canvas.width / DIGIT_SUPERSAMPLE;
|
|
201
|
+
const h = canvas.height / DIGIT_SUPERSAMPLE;
|
|
202
|
+
// 锚=字形盒左上角(应用 darwText align left/baseline top 同位),两分支都换算到
|
|
203
|
+
// 盒中心(着色器中心系顶点)。水平带中心=锚+半宽高;垂直带 -90°:fabric rotate(-90)
|
|
204
|
+
// 的字形下行朝屏幕右、advance 朝上——盒占 x∈[anchorX, anchorX+h]、y∈[anchorY-w, anchorY],
|
|
205
|
+
// 中心=(anchorX+h/2, anchorY-w/2)。批次 91 勘正:旋转分支曾把锚直接当中心(漏换算),
|
|
206
|
+
// 盒左移 h/2≈5px 贴带左缘(用户报「垂直标尺的文本太靠近左边了」)
|
|
207
|
+
const matrix = rotate90 ? [0, s, -s, 0, sx(anchorX + h / 2), sy(anchorY - w / 2)] : [s, 0, 0, s, sx(anchorX + w / 2), sy(anchorY + h / 2)];
|
|
208
|
+
return { matrix, dims: { x: w, y: h }, color: [1, 1, 1, 1], texture: canvas };
|
|
209
|
+
};
|
|
210
|
+
const size = style.ruleSize;
|
|
211
|
+
const drawBand = (horizontal) => {
|
|
212
|
+
const rulerLength = horizontal ? cssWidth : cssHeight;
|
|
213
|
+
// 背景(不透明白:盖住边带下的画布内容,应用同语义)
|
|
214
|
+
quads.push(horizontal ? rect(0, 0, cssWidth, size, style.backgroundColor) : rect(0, 0, size, cssHeight, style.backgroundColor));
|
|
215
|
+
// 工作区裁剪区间
|
|
216
|
+
const ws = input.workspaceRect;
|
|
217
|
+
const clip = ws ? (horizontal ? [ws.left, ws.left + ws.width] : [ws.top, ws.top + ws.height]) : null;
|
|
218
|
+
const startScene = horizontal ? -vpt[4] / zoom : -vpt[5] / zoom;
|
|
219
|
+
const plan = planRulerTicks(startScene, rulerLength / zoom, clip, zoom);
|
|
220
|
+
// 刻度:主刻度从带外缘起全长,副刻度从内缘 8px;宽 1px、浓度 TICK_ALPHA
|
|
221
|
+
// (fabric darwLine 0.6px AA 视觉等价——宽度收窄有 GL 亚像素丢弃风险,见常量注)
|
|
222
|
+
const tickRGBA = [style.tickColor[0], style.tickColor[1], style.tickColor[2], style.tickColor[3] * TICK_ALPHA];
|
|
223
|
+
const toScreen = (sceneV) => (horizontal ? (sceneV - startScene) * zoom : (sceneV - startScene) * zoom);
|
|
224
|
+
for (const v of plan.majors) {
|
|
225
|
+
const p = Math.round(toScreen(v));
|
|
226
|
+
quads.push(horizontal ? rect(p, 0, 1, size, tickRGBA) : rect(0, p, size, 1, tickRGBA));
|
|
227
|
+
}
|
|
228
|
+
for (const v of plan.minors) {
|
|
229
|
+
const p = Math.round(toScreen(v));
|
|
230
|
+
quads.push(horizontal ? rect(p, size - 8, 1, 8, tickRGBA) : rect(size - 8, p, 8, 1, tickRGBA));
|
|
231
|
+
}
|
|
232
|
+
// 数值:主刻度处;水平带 (p+6, 2.5),垂直带旋转 -90° 锚 (2.5, p-6)(应用同位)
|
|
233
|
+
for (const v of plan.majors) {
|
|
234
|
+
const p = toScreen(v);
|
|
235
|
+
const text = String(Math.round(v));
|
|
236
|
+
if (horizontal)
|
|
237
|
+
quads.push(digitQuad(text, p + 6, 2.5));
|
|
238
|
+
else
|
|
239
|
+
quads.push(digitQuad(text, 2.5, p - 6, true));
|
|
240
|
+
}
|
|
241
|
+
// 高亮:同轴合并段 → 边带投影
|
|
242
|
+
for (const span of mergeHighlightSpans(input.selectionRects, horizontal)) {
|
|
243
|
+
const p = (span.start - startScene) * zoom;
|
|
244
|
+
const len = span.length * zoom;
|
|
245
|
+
quads.push(horizontal ? rect(p, 0, len, size, style.highlightColor) : rect(0, p, size, len, style.highlightColor));
|
|
246
|
+
}
|
|
247
|
+
// 无外缘描边线(批次 90 对拍勘正):fabric 边带背景 darwRect stroke:''——边带
|
|
248
|
+
// 边界=白底与工作区灰遮罩的自然对比;引擎 1px 实色 borderColor 线是复刻加笔,
|
|
249
|
+
// 实测比 fabric 多一条全长灰线(用户观感「标尺线太粗」来源之一)
|
|
250
|
+
};
|
|
251
|
+
drawBand(true);
|
|
252
|
+
drawBand(false);
|
|
253
|
+
// 角块(单位标签居中近似;无描边——fabric darwRect stroke lineWidth=0.05 视觉不可见)
|
|
254
|
+
quads.push(rect(0, 0, size, size, style.backgroundColor));
|
|
255
|
+
const unitCanvas = digit(style.unitName);
|
|
256
|
+
quads.push(digitQuad(style.unitName, size / 2 - unitCanvas.width / DIGIT_SUPERSAMPLE / 2, size / 2 - unitCanvas.height / DIGIT_SUPERSAMPLE / 2));
|
|
257
|
+
// 参考线拖拽数值气泡(批次 72;app FabricRuler.drawReferenceLineValue 同构):
|
|
258
|
+
// 横线 → 气泡贴左带外侧(x=ruleSize+5),竖线 → 贴上带外侧(y=ruleSize+5);
|
|
259
|
+
// 沿带向位置 = 线位×zoom+vpt 平移,出画布钳边(app 同钳位式)
|
|
260
|
+
if (input.referenceLine) {
|
|
261
|
+
const badge = referenceBadgeCanvas(String(Math.round(input.referenceLine.position)));
|
|
262
|
+
const w = badge.width / DIGIT_SUPERSAMPLE;
|
|
263
|
+
const h = badge.height / DIGIT_SUPERSAMPLE;
|
|
264
|
+
let left;
|
|
265
|
+
let top;
|
|
266
|
+
if (input.referenceLine.axis === 'horizontal') {
|
|
267
|
+
const viewportPosition = input.referenceLine.position * zoom + vpt[5];
|
|
268
|
+
left = size + 5;
|
|
269
|
+
top = viewportPosition + h / 2;
|
|
270
|
+
if (top < 0)
|
|
271
|
+
top = 2;
|
|
272
|
+
if (top + h > cssHeight)
|
|
273
|
+
top = cssHeight - h - 2;
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
const viewportPosition = input.referenceLine.position * zoom + vpt[4];
|
|
277
|
+
left = viewportPosition + w / 2;
|
|
278
|
+
top = size + 5;
|
|
279
|
+
if (left < 0)
|
|
280
|
+
left = 2;
|
|
281
|
+
if (left + w > cssWidth)
|
|
282
|
+
left = cssWidth - w - 2;
|
|
283
|
+
}
|
|
284
|
+
quads.push({ matrix: [s, 0, 0, s, sx(left + w / 2), sy(top + h / 2)], dims: { x: w, y: h }, color: [1, 1, 1, 1], texture: badge });
|
|
285
|
+
}
|
|
286
|
+
return quads;
|
|
287
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 滚动文本渲染(P5-6 余第一片:引擎侧核心,接线批次随滤镜批落地后补)。
|
|
3
|
+
*
|
|
4
|
+
* 应用语义(src/extension/object/ScrollText.ts):
|
|
5
|
+
* - `type:'ScrollText'` 继承应用 Textbox——布局/换行/样式与普通 textbox 全同,
|
|
6
|
+
* 额外序列化 scrollDirection(缺省 left-to-right)/scrollSpeed(缺省 50)/
|
|
7
|
+
* scrollEnabled(缺省 true)/scrollDuration(派生量,引擎 raw 原样往返)。
|
|
8
|
+
* - 渲染 = `_renderTextFill`/`_renderTextStroke` 覆写:ctx.clip(对象盒) +
|
|
9
|
+
* ctx.translate(offsetX, 0) 后整块文本**画两份**(相距 textTotalWidth+viewWidth,
|
|
10
|
+
* 无缝循环)。背景高亮与装饰线走 fabric 原路径——**不滚也不裁**(应用 quirk,
|
|
11
|
+
* 引擎在渲染分派层保持同 z 序:bg → underline → 滚动字形 → overline → linethrough)。
|
|
12
|
+
* - 偏移由两条链路驱动:编辑态自滚 rAF(引擎静态渲染对应 offset=0 的静止态)与
|
|
13
|
+
* 播放态 fabricAnimater.applyScrollTextTimeline 的确定性求值(引擎
|
|
14
|
+
* `evaluateScrollTextOffset` 同源,播放接线在 EngineCanvas 侧)。
|
|
15
|
+
* - 方向语义按 canvas 求值口径:left-to-right 偏移为正、right-to-left 为负
|
|
16
|
+
* (两方向的可见运动同为向右——第二副本从左侧补入;公式照抄不解释)。
|
|
17
|
+
*
|
|
18
|
+
* 烘焙走 canvas2d(与 warp/arc/虚线描边同族先例):clip 的边缘 AA 与应用同
|
|
19
|
+
* 机制(ctx.clip),双副本同一次 AA——GL 蒙版路线的 FBO 合成边缘是纹理过滤
|
|
20
|
+
* 近似,parity 劣于 canvas 直出。offset 进签名:播放期逐帧重烘(量级同
|
|
21
|
+
* 动画族逐帧纹理重传),静止态恒缓存。
|
|
22
|
+
*/
|
|
23
|
+
import type { TextNode } from '../model/scene';
|
|
24
|
+
import type { ScrollTextInput } from '../model/animation';
|
|
25
|
+
export interface ScrollTextDecl {
|
|
26
|
+
direction: 'left-to-right' | 'right-to-left';
|
|
27
|
+
/** 像素/秒(渲染不用,播放轨时长消费;fromObject 口径:非数值才回落类缺省 50,0 原样保留→静止) */
|
|
28
|
+
speed: number;
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
}
|
|
31
|
+
/** 滚动声明解析:只认 ScrollText 类型(普通 textbox 带杂散字段不滚)。
|
|
32
|
+
* fromObject 口径——缺省回落类默认(direction L2R / enabled true),scrollEnabled
|
|
33
|
+
* 显式 false 关滚;speed 非数值回落 50(构造器 `options?.scrollSpeed || 50`),
|
|
34
|
+
* 数值(含 0)原样保留 */
|
|
35
|
+
export declare const scrollTextDecl: (raw: Record<string, unknown>) => ScrollTextDecl | null;
|
|
36
|
+
/**
|
|
37
|
+
* 双副本本地系平移(应用 `_renderTextFill` 公式逐式照抄):
|
|
38
|
+
* - L2R:copy1 = −W/2 − T + offset,copy2 = copy1 + (T+W)——offset=0 时 copy1
|
|
39
|
+
* 整体藏于视口左外、copy2 头部从盒中心起可见
|
|
40
|
+
* - R2L:copy1 = W/2 − offset,copy2 = copy1 − (T+W)(offset 恒负,canvas 求值口径)
|
|
41
|
+
* 两副本相距 T+W > 块宽 T,永不相交——绘制序无关紧要
|
|
42
|
+
*/
|
|
43
|
+
export declare const scrollRenderOffsets: (decl: Pick<ScrollTextDecl, "direction">, viewWidth: number, textTotalWidth: number, scrollOffset: number) => {
|
|
44
|
+
copy1: number;
|
|
45
|
+
copy2: number;
|
|
46
|
+
};
|
|
47
|
+
/** 播放轨求值输入(app getScrollTextDuration/applyScrollTextTimeline 的取数口径):
|
|
48
|
+
* viewWidth = 盒宽本地系(app scrollText.width 同源,不含 scale)、
|
|
49
|
+
* textTotalWidth = 最长行(SceneNode.textTotalWidth)。非 ScrollText 类型返回
|
|
50
|
+
* null——播放轨收集的顶层过滤门(app getScrollTextObjects 的 type 等价物) */
|
|
51
|
+
export declare const scrollTrackInput: (node: TextNode) => ScrollTextInput | null;
|
|
52
|
+
export interface ScrollBake {
|
|
53
|
+
canvas: HTMLCanvasElement;
|
|
54
|
+
/** 视口盒(对象盒)逻辑尺寸——quad 以 node.matrix 铺放 */
|
|
55
|
+
logicalW: number;
|
|
56
|
+
logicalH: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 滚动文本烘焙:clip = 对象盒(应用 getMaxEffectPadding 在文本族缺失恒 0——
|
|
60
|
+
* clip 矩形即盒),盒内画两份平移后的整块文本。填充逐字 fillText、描边逐字
|
|
61
|
+
* strokeText(fabric `_renderChars` 同机制);虚线描边按 run 一次 strokeText
|
|
62
|
+
* (相位 run 内连续,P3-2b 口径)。竖排走 verticalGlyphOps 摆位(fillText/
|
|
63
|
+
* strokeText 同一个 drawVerticalGlyph 出口)。paintFirst 决定填充/描边趟序。
|
|
64
|
+
*/
|
|
65
|
+
export declare const bakeScrollText: (node: TextNode, rasterScale: number, scrollOffset: number) => ScrollBake | null;
|