Bläddra i källkod

Missing a ratio fix

Popov72 5 år sedan
förälder
incheckning
cbbbeaf67f
1 ändrade filer med 4 tillägg och 2 borttagningar
  1. 4 2
      gui/src/2D/controls/scrollViewers/scrollViewer.ts

+ 4 - 2
gui/src/2D/controls/scrollViewers/scrollViewer.ts

@@ -244,8 +244,10 @@ export class ScrollViewer extends Rectangle {
     }
 
     private _buildClientSizes() {
-        this._window.parentClientWidth = this._currentMeasure.width - (this._verticalBar.isVisible || this.forceVerticalBar ? this._barSize : 0) - 2 * this.thickness;
-        this._window.parentClientHeight = this._currentMeasure.height - (this._horizontalBar.isVisible || this.forceHorizontalBar ? this._barSize : 0) - 2 * this.thickness;
+        let ratio = this.host.idealRatio;
+
+        this._window.parentClientWidth = this._currentMeasure.width - (this._verticalBar.isVisible || this.forceVerticalBar ? this._barSize * ratio : 0) - 2 * this.thickness;
+        this._window.parentClientHeight = this._currentMeasure.height - (this._horizontalBar.isVisible || this.forceHorizontalBar ? this._barSize * ratio : 0) - 2 * this.thickness;
 
         this._clientWidth = this._window.parentClientWidth;
         this._clientHeight = this._window.parentClientHeight;