public LayoutHelper(ILineTransformProvider lineTransformProvider, double newViewportTop, HashSet<ITextViewLine> oldVisibleLines, List<PhysicalLine> oldLines, IFormattedLineSource formattedLineSource, ITextViewModel textViewModel, ITextSnapshot visualSnapshot, ITextSnapshot editSnapshot) { this.lineTransformProvider = lineTransformProvider; requestedViewportTop = newViewportTop; this.oldLines = oldLines; this.formattedLineSource = formattedLineSource; this.textViewModel = textViewModel; this.visualSnapshot = visualSnapshot; toPhysicalLine = new Dictionary<IFormattedLine, PhysicalLine>(); this.oldVisibleLines = oldVisibleLines; Debug.Assert(oldLines.All(a => a.BufferSpan.Snapshot == editSnapshot)); foreach (var physLine in oldLines) { physLine.TranslateLinesTo(visualSnapshot, editSnapshot); foreach (var line in physLine.Lines) toPhysicalLine[line] = physLine; } }
public LayoutHelper(ILineTransformProvider lineTransformProvider, double newViewportTop, HashSet <ITextViewLine> oldVisibleLines, List <PhysicalLine> oldLines, IFormattedLineSource formattedLineSource, ITextViewModel textViewModel, ITextSnapshot visualSnapshot, ITextSnapshot editSnapshot) { this.lineTransformProvider = lineTransformProvider; requestedViewportTop = newViewportTop; this.oldLines = oldLines; this.formattedLineSource = formattedLineSource; this.textViewModel = textViewModel; this.visualSnapshot = visualSnapshot; toPhysicalLine = new Dictionary <IFormattedLine, PhysicalLine>(); this.oldVisibleLines = oldVisibleLines; Debug.Assert(oldLines.All(a => a.BufferSpan.Snapshot == editSnapshot)); foreach (var physLine in oldLines) { physLine.TranslateLinesTo(visualSnapshot, editSnapshot); foreach (var line in physLine.Lines) { toPhysicalLine[line] = physLine; } } }