Merge branch 'master' into user/rbrid/DataGridIssue2977

This commit is contained in:
Régis Brid 2019-10-16 14:55:28 -07:00 коммит произвёл GitHub
Родитель 424118be2d 7c933163ff
Коммит c10369f92f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -1209,6 +1209,12 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
{ {
cx += _negHorizontalOffset; cx += _negHorizontalOffset;
_horizontalOffset -= _negHorizontalOffset; _horizontalOffset -= _negHorizontalOffset;
if (_horizontalOffset < DATAGRID_roundingDelta)
{
// Snap to zero to avoid trying to partially scroll in first scrolled off column below
_horizontalOffset = 0;
}
_negHorizontalOffset = 0; _negHorizontalOffset = 0;
} }
else else
@ -1217,6 +1223,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
_negHorizontalOffset -= displayWidth - cx; _negHorizontalOffset -= displayWidth - cx;
cx = displayWidth; cx = displayWidth;
} }
// Make sure the HorizontalAdjustment is not greater than the new HorizontalOffset
// since it would cause an assertion failure in DataGridCellsPresenter.ShouldDisplayCell
// called by DataGridCellsPresenter.MeasureOverride.
this.HorizontalAdjustment = Math.Min(this.HorizontalAdjustment, _horizontalOffset);
} }
// second try to scroll entire columns // second try to scroll entire columns