()
| 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) { |
no test coverage detected