浏览代码

Fix paddingBottom of children not taken into account in ScrollViewer

Popov72 5 年之前
父节点
当前提交
bfab3d8c52
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      gui/src/2D/controls/scrollViewers/scrollViewerWindow.ts

+ 2 - 2
gui/src/2D/controls/scrollViewers/scrollViewerWindow.ts

@@ -301,8 +301,8 @@ export class _ScrollViewerWindow extends Container {
                 child._offsetTop(this._currentMeasure.top - child._currentMeasure.top);
             }
 
-            maxWidth = Math.max(maxWidth, child._currentMeasure.left - this._currentMeasure.left + child._currentMeasure.width);
-            maxHeight = Math.max(maxHeight, child._currentMeasure.top - this._currentMeasure.top + child._currentMeasure.height);
+            maxWidth = Math.max(maxWidth, child._currentMeasure.left - this._currentMeasure.left + child._currentMeasure.width + child.paddingRightInPixels);
+            maxHeight = Math.max(maxHeight, child._currentMeasure.top - this._currentMeasure.top + child._currentMeasure.height + child.paddingBottomInPixels);
         }
 
         if (this._currentMeasure.width !== maxWidth) {