Merge pull request #66 from knocte/fix_customscrollable_sample
sample: fix CustomScrollable sample to prevent too high Upper values
This commit is contained in:
commit
0188d30f7f
1 changed files with 6 additions and 0 deletions
|
@ -184,6 +184,9 @@ class CustomScrollableWidget<T> : CustomBase, IScrollableImplementor {
|
|||
if (hadjustment.Value + hadjustment.PageSize > hadjustment.Upper) {
|
||||
hadjustment.Value = hadjustment.Upper - hadjustment.PageSize;
|
||||
}
|
||||
if (hadjustment.Upper > 0 && hadjustment.Upper < hadjustment.PageSize) {
|
||||
hadjustment.Upper = hadjustment.PageSize;
|
||||
}
|
||||
hadjustment.Change ();
|
||||
}
|
||||
|
||||
|
@ -193,6 +196,9 @@ class CustomScrollableWidget<T> : CustomBase, IScrollableImplementor {
|
|||
if (vadjustment.Value + vadjustment.PageSize > vadjustment.Upper) {
|
||||
vadjustment.Value = vadjustment.Upper - vadjustment.PageSize;
|
||||
}
|
||||
if (vadjustment.Upper > 0 && vadjustment.Upper < vadjustment.PageSize) {
|
||||
vadjustment.Upper = vadjustment.PageSize;
|
||||
}
|
||||
vadjustment.Change ();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue