Making markdown widget jump around less

This commit is contained in:
LarsBrubaker 2018-06-24 09:47:31 -07:00
parent e9d59d4fa2
commit 1f3b910615
3 changed files with 14 additions and 12 deletions

View file

@ -40,6 +40,18 @@ namespace Markdig.Agg
this.ScrollArea.VAnchor = VAnchor.Fit;
}
var lastScroll = this.TopLeftOffset;
this.ScrollPositionChanged += (s, e) =>
{
lastScroll = TopLeftOffset;
};
// make sure as the scrolling area changes height we maintain our current scroll position
this.ScrollArea.BoundsChanged += (s, e) =>
{
TopLeftOffset = lastScroll;
};
contentPanel = new FlowLayoutWidget(FlowDirection.TopToBottom)
{
HAnchor = HAnchor.Stretch,