Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit fd0bd6d

Browse files
authored
Merge pull request #234 from finnif/master
fix: hide scrollbar when scrollview content is not full.
2 parents d053031 + c53d4d6 commit fd0bd6d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Runtime/widgets/scrollbar.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using Unity.UIWidgets.animation;
32
using Unity.UIWidgets.foundation;
43
using Unity.UIWidgets.painting;
@@ -130,14 +129,14 @@ painterDelegate painter
130129
this.minLength * (((inside / viewport) - 0.8f) / 0.2f)
131130
);
132131
}
133-
}
134132

135-
float fractionPast = before / (before + after);
136-
float thumbOffset = (before + after > 0.0)
137-
? fractionPast * (viewport - thumbExtent - 2 * this.mainAxisMargin) + this.mainAxisMargin
138-
: this.mainAxisMargin;
133+
float fractionPast = before / (before + after);
134+
float thumbOffset = (before + after > 0.0)
135+
? fractionPast * (viewport - thumbExtent - 2 * this.mainAxisMargin) + this.mainAxisMargin
136+
: this.mainAxisMargin;
139137

140-
painter(canvas, size, thumbOffset, thumbExtent);
138+
painter(canvas, size, thumbOffset, thumbExtent);
139+
}
141140
}
142141

143142
public override void dispose() {

0 commit comments

Comments
 (0)