@univerjs/engine-render 0.2.8 → 0.2.9
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/lib/cjs/index.js +3 -3
- package/lib/es/index.js +290 -189
- package/lib/types/base-object.d.ts +4 -2
- package/lib/types/components/docs/document.d.ts +1 -2
- package/lib/types/components/docs/layout/block/paragraph/language-ruler.d.ts +5 -5
- package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +1 -1
- package/lib/types/components/docs/layout/doc-skeleton.d.ts +2 -0
- package/lib/types/components/docs/layout/tools.d.ts +2 -2
- package/lib/types/components/docs/liquid.d.ts +1 -1
- package/lib/types/components/docs/text-selection/text-selection-render-manager.d.ts +1 -1
- package/lib/types/components/docs/view-model/document-view-model.d.ts +2 -0
- package/lib/types/components/sheets/sheet-skeleton.d.ts +9 -1
- package/lib/types/components/sheets/spreadsheet.d.ts +0 -2
- package/lib/types/render-manager/render-unit.d.ts +17 -3
- package/lib/types/scene.d.ts +13 -6
- package/lib/types/shape/rich-text.d.ts +1 -5
- package/lib/types/viewport.d.ts +15 -33
- package/lib/umd/index.js +3 -3
- package/package.json +6 -6
|
@@ -7,6 +7,8 @@ import { IViewportInfo, Vector2 } from './basics/vector2';
|
|
|
7
7
|
import { UniverRenderingContext } from './context';
|
|
8
8
|
import { Layer } from './layer';
|
|
9
9
|
import { ITransformerConfig } from './basics/transformer-config';
|
|
10
|
+
import { Scene } from './scene';
|
|
11
|
+
import { Engine } from './engine';
|
|
10
12
|
export declare const BASE_OBJECT_ARRAY: string[];
|
|
11
13
|
export declare enum ObjectType {
|
|
12
14
|
UNKNOWN = 0,
|
|
@@ -161,10 +163,10 @@ export declare abstract class BaseObject extends Disposable {
|
|
|
161
163
|
triggerDrop(evt: IDragEvent | IMouseEvent): boolean;
|
|
162
164
|
dispose(): void;
|
|
163
165
|
toJson(): IKeyValue;
|
|
164
|
-
getScene():
|
|
166
|
+
getScene(): Nullable<Scene>;
|
|
165
167
|
resetCursor(): void;
|
|
166
168
|
setCursor(val: CURSOR_TYPE): void;
|
|
167
|
-
getEngine():
|
|
169
|
+
getEngine(): Nullable<Engine>;
|
|
168
170
|
getObjects(): BaseObject[];
|
|
169
171
|
getLayerIndex(): number;
|
|
170
172
|
applyTransform(): void;
|
|
@@ -3,7 +3,6 @@ import { IDocumentSkeletonPage } from '../../basics/i-document-skeleton-cached';
|
|
|
3
3
|
import { Transform } from '../../basics/transform';
|
|
4
4
|
import { IViewportInfo } from '../../basics/vector2';
|
|
5
5
|
import { UniverRenderingContext } from '../../context';
|
|
6
|
-
import { Scene } from '../../scene';
|
|
7
6
|
import { IDocumentsConfig, IPageMarginLayout, DocComponent } from './doc-component';
|
|
8
7
|
import { DocumentSkeleton } from './layout/doc-skeleton';
|
|
9
8
|
export interface IPageRenderConfig {
|
|
@@ -27,7 +26,7 @@ export declare class Documents extends DocComponent {
|
|
|
27
26
|
static create(oKey: string, documentSkeleton?: DocumentSkeleton, config?: IDocumentsConfig): Documents;
|
|
28
27
|
dispose(): void;
|
|
29
28
|
getOffsetConfig(): IDocumentOffsetConfig;
|
|
30
|
-
getEngine(): Nullable<import('../..').
|
|
29
|
+
getEngine(): Nullable<import('../..').Engine>;
|
|
31
30
|
changeSkeleton(newSkeleton: DocumentSkeleton): this;
|
|
32
31
|
protected _draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
33
32
|
draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IParagraph } from '@univerjs/core';
|
|
2
2
|
import { ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
3
3
|
import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
|
|
4
4
|
import { DocumentViewModel } from '../../../view-model/document-view-model';
|
|
5
|
-
export declare function otherHandler(index: number, charArray: string, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig,
|
|
5
|
+
export declare function otherHandler(index: number, charArray: string, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraph: IParagraph): {
|
|
6
6
|
step: number;
|
|
7
7
|
glyphGroup: import('../../../../..').IDocumentSkeletonGlyph[];
|
|
8
8
|
};
|
|
9
|
-
export declare function ArabicHandler(index: number, charArray: string, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig,
|
|
9
|
+
export declare function ArabicHandler(index: number, charArray: string, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraph: IParagraph): {
|
|
10
10
|
step: number;
|
|
11
11
|
glyphGroup: import('../../../../..').IDocumentSkeletonGlyph[];
|
|
12
12
|
};
|
|
13
|
-
export declare function emojiHandler(index: number, charArray: string, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig,
|
|
13
|
+
export declare function emojiHandler(index: number, charArray: string, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraph: IParagraph): {
|
|
14
14
|
step: number;
|
|
15
15
|
glyphGroup: import('../../../../..').IDocumentSkeletonGlyph[];
|
|
16
16
|
};
|
|
17
|
-
export declare function TibetanHandler(index: number, charArray: string, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig,
|
|
17
|
+
export declare function TibetanHandler(index: number, charArray: string, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraph: IParagraph): {
|
|
18
18
|
step: number;
|
|
19
19
|
glyphGroup: import('../../../../..').IDocumentSkeletonGlyph[];
|
|
20
20
|
};
|
|
@@ -2,5 +2,5 @@ import { IDocumentSkeletonDrawing, IDocumentSkeletonGlyph, IDocumentSkeletonLine
|
|
|
2
2
|
import { IParagraphConfig, ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
3
3
|
import { ILayoutContext } from '../../tools';
|
|
4
4
|
import { BreakPointType } from '../../line-breaker/break';
|
|
5
|
-
export declare function layoutParagraph(ctx: ILayoutContext, glyphGroup: IDocumentSkeletonGlyph[], pages: IDocumentSkeletonPage[], sectionBreakConfig: ISectionBreakConfig, paragraphConfig: IParagraphConfig,
|
|
5
|
+
export declare function layoutParagraph(ctx: ILayoutContext, glyphGroup: IDocumentSkeletonGlyph[], pages: IDocumentSkeletonPage[], sectionBreakConfig: ISectionBreakConfig, paragraphConfig: IParagraphConfig, isParagraphFirstShapedText: boolean, breakPointType?: BreakPointType): IDocumentSkeletonPage[];
|
|
6
6
|
export declare function updateInlineDrawingPosition(line: IDocumentSkeletonLine, paragraphInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>, blockAnchorTop?: number): void;
|
|
@@ -17,6 +17,8 @@ export interface IFindNodeRestrictions {
|
|
|
17
17
|
}
|
|
18
18
|
export declare class DocumentSkeleton extends Skeleton {
|
|
19
19
|
private _docViewModel;
|
|
20
|
+
private _dirty$;
|
|
21
|
+
readonly dirty$: import('rxjs').Observable<boolean>;
|
|
20
22
|
private _skeletonData;
|
|
21
23
|
private _findLiquid;
|
|
22
24
|
private _hyphen;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocumentDataModel, INumberUnit, IObjectPositionH, IObjectPositionV, IParagraphStyle, ITextStyle, Nullable, BooleanNumber, GridType, SpacingRule } from '@univerjs/core';
|
|
1
|
+
import { DocumentDataModel, INumberUnit, IObjectPositionH, IObjectPositionV, IParagraph, IParagraphStyle, ITextStyle, Nullable, BooleanNumber, GridType, SpacingRule } from '@univerjs/core';
|
|
2
2
|
import { IDocumentSkeletonCached, IDocumentSkeletonColumn, IDocumentSkeletonDivide, IDocumentSkeletonDrawing, IDocumentSkeletonFontStyle, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonPage, IDocumentSkeletonSection, ISkeletonResourceReference } from '../../../basics/i-document-skeleton-cached';
|
|
3
3
|
import { IDocsConfig, IParagraphConfig, ISectionBreakConfig } from '../../../basics/interfaces';
|
|
4
4
|
import { DataStreamTreeNode } from '../view-model/data-stream-tree-node';
|
|
@@ -72,7 +72,7 @@ export declare function getFontConfigFromLastGlyph(glyph: IDocumentSkeletonGlyph
|
|
|
72
72
|
snapToGrid: BooleanNumber;
|
|
73
73
|
pageWidth: number;
|
|
74
74
|
};
|
|
75
|
-
export declare function getFontCreateConfig(index: number, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig,
|
|
75
|
+
export declare function getFontCreateConfig(index: number, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraph: IParagraph): IFontCreateConfig;
|
|
76
76
|
export declare function getNullSkeleton(): IDocumentSkeletonCached;
|
|
77
77
|
export declare function setPageParent(pages: IDocumentSkeletonPage[], parent: IDocumentSkeletonCached): void;
|
|
78
78
|
export interface ILayoutContext {
|
|
@@ -24,7 +24,7 @@ export declare class Liquid {
|
|
|
24
24
|
x: number;
|
|
25
25
|
y: number;
|
|
26
26
|
};
|
|
27
|
-
translateLine(line: IDocumentSkeletonLine,
|
|
27
|
+
translateLine(line: IDocumentSkeletonLine, includeMarginTop?: boolean, includePaddingTop?: boolean): {
|
|
28
28
|
x: number;
|
|
29
29
|
y: number;
|
|
30
30
|
};
|
|
@@ -177,7 +177,7 @@ export declare class TextSelectionRenderManager extends RxDisposable implements
|
|
|
177
177
|
private _addTextRange;
|
|
178
178
|
private _addRectRangesToCache;
|
|
179
179
|
private _addRectRanges;
|
|
180
|
-
private
|
|
180
|
+
private _createTextRangeByAnchorPosition;
|
|
181
181
|
private _updateActiveRangePosition;
|
|
182
182
|
private _isEmpty;
|
|
183
183
|
private _getCanvasOffset;
|
|
@@ -25,6 +25,8 @@ export declare class DocumentViewModel implements IDisposable {
|
|
|
25
25
|
readonly editAreaChange$: import('rxjs').Observable<Nullable<DocumentEditArea>>;
|
|
26
26
|
headerTreeMap: Map<string, DocumentViewModel>;
|
|
27
27
|
footerTreeMap: Map<string, DocumentViewModel>;
|
|
28
|
+
private readonly _segmentViewModels$;
|
|
29
|
+
readonly segmentViewModels$: import('rxjs').Observable<DocumentViewModel[]>;
|
|
28
30
|
constructor(_documentDataModel: DocumentDataModel);
|
|
29
31
|
registerCustomRangeInterceptor(interceptor: ICustomRangeInterceptor): IDisposable;
|
|
30
32
|
dispose(): void;
|
|
@@ -35,6 +35,10 @@ export declare const DEFAULT_PADDING_DATA: {
|
|
|
35
35
|
r: number;
|
|
36
36
|
};
|
|
37
37
|
export declare const RENDER_RAW_FORMULA_KEY = "RENDER_RAW_FORMULA";
|
|
38
|
+
export interface ICacheItem {
|
|
39
|
+
bg: boolean;
|
|
40
|
+
border: boolean;
|
|
41
|
+
}
|
|
38
42
|
export declare class SpreadsheetSkeleton extends Skeleton {
|
|
39
43
|
readonly worksheet: Worksheet;
|
|
40
44
|
/**
|
|
@@ -106,6 +110,10 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
106
110
|
calculate(bounds?: IViewportInfo): this;
|
|
107
111
|
calculateAutoHeightInRange(ranges: Nullable<IRange[]>): IRowAutoHeightInfo[];
|
|
108
112
|
private _calculateRowAutoHeight;
|
|
113
|
+
/**
|
|
114
|
+
* Calculate data for row col & cell position, then update position value to this._rowHeaderWidth & this._rowHeightAccumulation & this._columnHeaderHeight & this._columnWidthAccumulation.
|
|
115
|
+
* @returns this
|
|
116
|
+
*/
|
|
109
117
|
private _updateLayout;
|
|
110
118
|
private _dynamicallyUpdateRowHeaderWidth;
|
|
111
119
|
getRowColumnSegment(bounds?: IViewportInfo): IRange;
|
|
@@ -275,7 +283,7 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
275
283
|
private _resetCache;
|
|
276
284
|
resetCache(): void;
|
|
277
285
|
private _makeDocumentSkeletonDirty;
|
|
278
|
-
private
|
|
286
|
+
private _setCellStylesCache;
|
|
279
287
|
private _updateConfigAndGetDocumentModel;
|
|
280
288
|
private _getDocumentDataByStyle;
|
|
281
289
|
/**
|
|
@@ -2,6 +2,11 @@ import { Dependency, DependencyIdentifier, IDisposable, Nullable, UnitModel, Uni
|
|
|
2
2
|
import { Engine } from '../engine';
|
|
3
3
|
import { Scene } from '../scene';
|
|
4
4
|
import { RenderComponentType } from './render-manager.service';
|
|
5
|
+
/**
|
|
6
|
+
* Public interface of a {@link RenderUnit}.
|
|
7
|
+
*
|
|
8
|
+
* @property {string} unitId - The id of the RenderUnit.
|
|
9
|
+
*/
|
|
5
10
|
export interface IRender {
|
|
6
11
|
unitId: string;
|
|
7
12
|
type: UniverInstanceType;
|
|
@@ -13,17 +18,22 @@ export interface IRender {
|
|
|
13
18
|
isThumbNail?: boolean;
|
|
14
19
|
with<T>(dependency: DependencyIdentifier<T>): T;
|
|
15
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Every render module should implement this interface.
|
|
23
|
+
*/
|
|
16
24
|
export interface IRenderModule extends IDisposable {
|
|
17
25
|
}
|
|
18
26
|
/**
|
|
19
|
-
* This
|
|
27
|
+
* Necessary context for a render module.This interface would be the first argument of render modules' constructor
|
|
28
|
+
* functions.
|
|
20
29
|
*/
|
|
21
30
|
export interface IRenderContext<T extends UnitModel = UnitModel> extends Omit<IRender, 'with'> {
|
|
22
31
|
unit: T;
|
|
23
32
|
type: UnitType;
|
|
24
33
|
}
|
|
25
34
|
/**
|
|
26
|
-
*
|
|
35
|
+
* This class is necessary for Univer to render several units in the same webpage. It encapsulates the rendering
|
|
36
|
+
* context and rendering modules for a specific unit.
|
|
27
37
|
*/
|
|
28
38
|
export declare class RenderUnit extends Disposable implements IRender {
|
|
29
39
|
readonly isRenderUnit: boolean;
|
|
@@ -43,9 +53,13 @@ export declare class RenderUnit extends Disposable implements IRender {
|
|
|
43
53
|
constructor(init: Pick<IRenderContext, 'engine' | 'scene' | 'isMainScene' | 'unit'>, parentInjector: Injector);
|
|
44
54
|
dispose(): void;
|
|
45
55
|
/**
|
|
46
|
-
* Get
|
|
56
|
+
* Get a dependency from the RenderUnit's injector.
|
|
47
57
|
*/
|
|
48
58
|
with<T>(dependency: DependencyIdentifier<T>): T;
|
|
59
|
+
/**
|
|
60
|
+
* Add render dependencies to the RenderUnit's injector. Note that the dependencies would be initialized immediately
|
|
61
|
+
* after being added.
|
|
62
|
+
*/
|
|
49
63
|
addRenderDependencies(dependencies: Dependency[]): void;
|
|
50
64
|
private _initDependencies;
|
|
51
65
|
}
|
package/lib/types/scene.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { ThinEngine } from './thin-engine';
|
|
|
12
12
|
import { ThinScene } from './thin-scene';
|
|
13
13
|
import { Viewport } from './viewport';
|
|
14
14
|
import { ITransformerConfig } from './basics/transformer-config';
|
|
15
|
+
import { Engine } from './engine';
|
|
15
16
|
export declare class Scene extends ThinScene {
|
|
16
17
|
private _parent;
|
|
17
18
|
private _layers;
|
|
@@ -48,8 +49,10 @@ export declare class Scene extends ThinScene {
|
|
|
48
49
|
resize(width?: number, height?: number): this;
|
|
49
50
|
setScaleValue(scaleX: number, scaleY: number): void;
|
|
50
51
|
/**
|
|
51
|
-
* scale to
|
|
52
|
-
*
|
|
52
|
+
* Set scale, and then emit event to update Viewport scroll state.
|
|
53
|
+
* @param scaleX
|
|
54
|
+
* @param scaleY
|
|
55
|
+
* @returns Scene
|
|
53
56
|
*/
|
|
54
57
|
scale(scaleX?: number, scaleY?: number): this;
|
|
55
58
|
/**
|
|
@@ -57,19 +60,23 @@ export declare class Scene extends ThinScene {
|
|
|
57
60
|
*/
|
|
58
61
|
scaleBy(scaleX?: number, scaleY?: number): this;
|
|
59
62
|
/**
|
|
60
|
-
*
|
|
61
|
-
* scene._setTransForm --> viewport@resetCanvasSizeAndUpdateScrollBar ---> scrollTo ---> limitedScroll ---> onScrollBeforeObserver ---> setScrollInfo
|
|
62
|
-
* scrollInfo needs accurate scene width & height, limitedScroll depends on scene & engine's width & height
|
|
63
|
+
* Reset canvas size and update scroll
|
|
63
64
|
* @param state
|
|
64
65
|
*/
|
|
65
66
|
transformByState(state: ISceneTransformState): void;
|
|
66
67
|
getParent(): ThinEngine<Scene> | SceneViewer;
|
|
67
|
-
getEngine(): Nullable<
|
|
68
|
+
getEngine(): Nullable<Engine>;
|
|
68
69
|
getLayers(): Layer[];
|
|
69
70
|
getLayer(zIndex?: number): Layer;
|
|
70
71
|
getLayerMaxZIndex(): number;
|
|
71
72
|
addLayer(...argument: Layer[]): void;
|
|
72
73
|
addObjects(objects: BaseObject[], zIndex?: number): this;
|
|
74
|
+
/**
|
|
75
|
+
* Add object to Layer (Layer is specified by zIndex).
|
|
76
|
+
* @param o
|
|
77
|
+
* @param zIndex layer index
|
|
78
|
+
* @returns scene
|
|
79
|
+
*/
|
|
73
80
|
addObject(o: BaseObject, zIndex?: number): this;
|
|
74
81
|
/**
|
|
75
82
|
* make object parent to scene
|
|
@@ -90,11 +90,7 @@ export declare class RichText extends BaseObject {
|
|
|
90
90
|
private _convertToDocumentData;
|
|
91
91
|
private _initialProps;
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
94
|
-
* it should be invoked when _documentData changed.
|
|
95
|
-
* _documentData changed ---> update _documentSkeleton & _documentSkeleton
|
|
96
|
-
*
|
|
97
|
-
* now it is invoked when transformByState(change editor size) & end of editing
|
|
93
|
+
* After changing editor size & end of editing, update skeleton of doc.
|
|
98
94
|
*/
|
|
99
95
|
refreshDocumentByDocData(): void;
|
|
100
96
|
/**
|
package/lib/types/viewport.d.ts
CHANGED
|
@@ -195,10 +195,6 @@ export declare class Viewport {
|
|
|
195
195
|
set preCacheBound(val: IBoundRectNoAngle | null);
|
|
196
196
|
enable(): void;
|
|
197
197
|
disable(): void;
|
|
198
|
-
/**
|
|
199
|
-
* invoked when canvas element size change
|
|
200
|
-
* engineResizeObserver --> engine.resizeBySize --> scene._setTransForm
|
|
201
|
-
*/
|
|
202
198
|
resetCanvasSizeAndUpdateScroll(): void;
|
|
203
199
|
setScrollBar(instance: BaseScrollBar): void;
|
|
204
200
|
removeScrollBar(): void;
|
|
@@ -216,32 +212,8 @@ export declare class Viewport {
|
|
|
216
212
|
setPadding(param: IPosition): void;
|
|
217
213
|
resetPadding(): void;
|
|
218
214
|
/**
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
* 1. changing the frozen row & col settings
|
|
222
|
-
* 2. changing curr skeleton
|
|
223
|
-
* 3. changing selection which cross viewport
|
|
224
|
-
* 4. changing the viewport size (also include change window size)
|
|
225
|
-
* 5. changing the scroll bar position
|
|
226
|
-
*
|
|
227
|
-
* when scrolling by trackpad:
|
|
228
|
-
* scene.input-manager@_onMouseWheel --> scene@triggerMouseWheel --> sheet-render.controller@scene.onMouseWheel$.add -->
|
|
229
|
-
* set-scroll.command.ts --> scroll.operation.ts -->
|
|
230
|
-
* scrollManagerService.setScrollInfoAndEmitEvent
|
|
231
|
-
*
|
|
232
|
-
* when change skelenton:
|
|
233
|
-
* _currentSkeletonBefore$ ---> scroll.render-controller@_updateSceneSize --> setSearchParam --> scene@_setTransForm ---> viewport.resetCanvasSizeAndUpdateScrollBar ---> scrollToXX
|
|
234
|
-
* --> onScrollAfterObserver.notifyObservers --> scroll.render-controller@onScrollAfterObserver ---> setScrollInfoToCurrSheetWithoutNotify ---> sms._setScrollInfo
|
|
235
|
-
*
|
|
236
|
-
* _currentSkeleton$ ---> selection.render-controller ---> formula@_autoScroll ---> viewport.resize ---> get scrollXY by viewportScrollXY ---> scrollTo
|
|
237
|
-
* _currentSkeleton$ ---> selection.render-controller ---> setCurrentSelection ---> formula@_autoScroll ---> scrollTo
|
|
238
|
-
* _currentSkeleton$ ---> freeze.render-controller@_refreshFreeze --> viewport.resize ---> scrollTo ---> _scroll
|
|
239
|
-
*
|
|
240
|
-
* Debug
|
|
241
|
-
* window.scene.getViewports()[0].scrollTo({x: 14.2, y: 1.8}, true)
|
|
242
|
-
*
|
|
243
|
-
* @param pos
|
|
244
|
-
*
|
|
215
|
+
* ScrollBar scroll to certain position.
|
|
216
|
+
* @param pos position of scrollBar
|
|
245
217
|
*/
|
|
246
218
|
scrollToBarPos(pos: Partial<IScrollBarPosition>): {
|
|
247
219
|
scrollX: number;
|
|
@@ -262,6 +234,12 @@ export declare class Viewport {
|
|
|
262
234
|
isLimitedY: boolean;
|
|
263
235
|
} | undefined;
|
|
264
236
|
scrollByBar(delta: Partial<IScrollBarPosition>, isTrigger?: boolean): void;
|
|
237
|
+
/**
|
|
238
|
+
* Viewport scroll to certain position.
|
|
239
|
+
* @param pos
|
|
240
|
+
* @param isTrigger
|
|
241
|
+
* @returns IViewportScrollPosition
|
|
242
|
+
*/
|
|
265
243
|
scrollToViewportPos(pos: Partial<IViewportScrollPosition>, isTrigger?: boolean): {
|
|
266
244
|
viewportScrollX: number;
|
|
267
245
|
viewportScrollY: number;
|
|
@@ -303,12 +281,16 @@ export declare class Viewport {
|
|
|
303
281
|
y: number;
|
|
304
282
|
};
|
|
305
283
|
getScrollBar(): Nullable<BaseScrollBar>;
|
|
284
|
+
/**
|
|
285
|
+
* Just record state of scroll. This method won't scroll viewport and scrollbar.
|
|
286
|
+
* @param current
|
|
287
|
+
* @returns Viewport
|
|
288
|
+
*/
|
|
306
289
|
updateScrollVal(current: Partial<IScrollObserverParam>): this;
|
|
307
290
|
getScrollBarTransForm(): Transform;
|
|
308
291
|
shouldIntoRender(): boolean;
|
|
309
292
|
/**
|
|
310
|
-
*
|
|
311
|
-
* that means each layer call all viewports to render
|
|
293
|
+
* Render function in each render loop.
|
|
312
294
|
* @param parentCtx parentCtx is cacheCtx from layer when layer._allowCache is true
|
|
313
295
|
* @param objects
|
|
314
296
|
* @param isMaxLayer
|
|
@@ -365,7 +347,7 @@ export declare class Viewport {
|
|
|
365
347
|
*/
|
|
366
348
|
private _resizeCacheCanvas;
|
|
367
349
|
/**
|
|
368
|
-
*
|
|
350
|
+
* Update scroll when viewport is resizing and removing rol & col
|
|
369
351
|
*/
|
|
370
352
|
private _updateScrollByViewportScrollValue;
|
|
371
353
|
private _getViewPortSize;
|