MCPcopy Create free account
hub / github.com/esengine/esengine / handleSizeChanged

Method handleSizeChanged

packages/fairygui/src/scroll/ScrollPane.ts:490–510  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

488 }
489
490 private handleSizeChanged(): void {
491 if (this._scrollType === EScrollType.Horizontal || this._scrollType === EScrollType.Both) {
492 this._overlapWidth = Math.ceil(Math.max(0, this._contentWidth - this._viewWidth));
493 } else {
494 this._overlapWidth = 0;
495 }
496
497 if (this._scrollType === EScrollType.Vertical || this._scrollType === EScrollType.Both) {
498 this._overlapHeight = Math.ceil(Math.max(0, this._contentHeight - this._viewHeight));
499 } else {
500 this._overlapHeight = 0;
501 }
502
503 // Clamp scroll positions
504 this._scrollX = clamp(this._scrollX, 0, this._overlapWidth);
505 this._scrollY = clamp(this._scrollY, 0, this._overlapHeight);
506
507 // Update container position
508 this._containerX = clamp(this._containerX, -this._overlapWidth, 0);
509 this._containerY = clamp(this._containerY, -this._overlapHeight, 0);
510 }
511
512 private posChanged(bAnimate: boolean): void {
513 if (bAnimate && !this._dragged) {

Callers 2

onOwnerSizeChangedMethod · 0.95
setContentSizeMethod · 0.95

Calls 2

clampFunction · 0.70
maxMethod · 0.45

Tested by

no test coverage detected