1 write to _viewport
Aspire.Tray.Tests (1)
src\Aspire.Tray\Common\TrayPanel.cs (1)
807_viewport = new(0, HeaderHeight + noticeHeight, Width, Math.Max(0, height - chrome));
29 references to _viewport
Aspire.Tray.Tests (29)
src\Aspire.Tray\Common\TrayPanel.cs (29)
117return _viewport; 376_scroll = Math.Clamp(before - deltaY, 0, Math.Max(0, _contentHeight - _viewport.Height)); 487if (bottom > _viewport.Bottom) 489_scroll += Math.Min(bottom - _viewport.Bottom, Math.Max(0, top - _viewport.Y)); 526if (bottom > _viewport.Bottom) 528_scroll += bottom - _viewport.Bottom; 530if (top < _viewport.Y) 532_scroll -= _viewport.Y - top; 605else if (target.Bounds.Y < _viewport.Y) 607_scroll -= _viewport.Y - target.Bounds.Y; 609else if (target.Bounds.Bottom > _viewport.Bottom) 611_scroll += target.Bounds.Bottom - _viewport.Bottom; 808_scroll = Math.Clamp(_scroll, 0, Math.Max(0, _contentHeight - _viewport.Height)); 809var listOrigin = _viewport.Y - _scroll; 839commands.Add(new FillPathCommand(PanelPath.Rectangle(new(0, _viewport.Y, Width, 1)), palette.Separator)); 844commands.Add(new PushClipCommand(_viewport)); 851var sink = top + item.Height <= _viewport.Y || top >= _viewport.Bottom ? hidden : commands; 887if (_contentHeight > _viewport.Height && _viewport.Height > 0) 889var thumb = Math.Max(24, _viewport.Height * _viewport.Height / _contentHeight); 890var travel = _viewport.Height - thumb - 8; 891var thumbY = _viewport.Y + 4 + travel * _scroll / (_contentHeight - _viewport.Height); 910var clip = IsChrome(focused.Kind) ? panel : _viewport; 1366var hit = IsChrome(key.Kind) ? bounds : bounds.Intersect(_viewport); 1382_accessible.Add(new(PanelAccessibleKey.For(label), PanelAccessibleRole.Text, text, bounds, chrome ? bounds : bounds.Intersect(_viewport)));