@univerjs/engine-render 0.2.8 → 0.2.10

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.
@@ -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
- * There are serval cases to call this method.
220
- * the most common case is scrolling. Other situations include:
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
- * call stack: engine.renderLoop ---> scene.render ---> layer.render ---> viewport.render
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
- * This method will be invoked when viewport is resizing and removing rol & col
350
+ * Update scroll when viewport is resizing and removing rol & col
369
351
  */
370
352
  private _updateScrollByViewportScrollValue;
371
353
  private _getViewPortSize;