src\Framework\MS\Internal\Documents\TextBoxView.cs (10)
709firstLineIndex = Math.Max(firstLineIndex, GetLineIndexFromOffset(startOffset, LogicalDirection.Forward));
779int nextLineIndex = Math.Max(0, Math.Min(_lineMetrics.Count - 1, lineIndex + count));
2045int startOffset = Math.Max(_lineMetrics[lineIndex].Offset, unclippedStartOffset);
2141int startOffset = Math.Max(lineStartOffset, unclippedStartOffset);
2204firstLineIndex = Math.Max(0, Math.Min(firstLineIndex, _lineMetrics.Count - 1));
2205lastLineIndex = Math.Max(0, Math.Min(lastLineIndex, _lineMetrics.Count - 1));
2551int lastCoveredCharOffset = range.StartIndex + Math.Max(range.PositionsAdded, range.PositionsRemoved);
2710int lineIndex = Math.Max(oldLineVisualsIndex, firstLineIndex);
2805count = Math.Max(0, count);
2970int rangeStart = Math.Max(viewportStart, selectionStart);
src\Framework\MS\Internal\PtsHost\ContainerParagraph.cs (8)
540fsrcToFillSubtrack.u = Math.Max(Math.Min(fsrcToFillSubtrack.u, fsrcToFill.u + fsrcToFill.du - 1), fsrcToFill.u);
541fsrcToFillSubtrack.du = Math.Max(fsrcToFillSubtrack.du, 0);
554fsrcToFillSubtrack.v = Math.Max(Math.Min(fsrcToFillSubtrack.v, fsrcToFill.v + fsrcToFill.dv - 1), fsrcToFill.v);
555fsrcToFillSubtrack.dv = Math.Max(fsrcToFillSubtrack.dv, 0);
705urSubtrack = Math.Max(Math.Min(urTrack + mbp.MBPLeft, urTrack + durTrack - 1), urTrack);
706durSubtrack = Math.Max(durTrack - (mbp.MBPLeft + mbp.MBPRight), 0);
842urSubtrack = Math.Max(Math.Min(urTrack + mbp.MBPLeft, urTrack + durTrack - 1), urTrack);
843durSubtrack = Math.Max(durTrack - (mbp.MBPLeft + mbp.MBPRight), 0);
src\Framework\MS\Internal\PtsHost\SubpageParagraph.cs (16)
195subpageWidth = Math.Max(1, subpageWidth - (mbp.MBPLeft + mbp.MBPRight));
204subpageHeight = Math.Max(1, subpageHeight - (marginTop + mbp.BPTop));
258dvrUsed = Math.Max(dvrUsed, fsbbox.fsrc.dv + fsbbox.fsrc.v);
259fsrcToFill.du = Math.Max(fsrcToFill.du, fsbbox.fsrc.du + fsbbox.fsrc.u);
302fsbbox.fsrc.du = Math.Max(fsrcToFill.du - (mbp.MarginLeft + mbp.MarginRight), 0);
303fsbbox.fsrc.dv = Math.Max(dvrUsed - dvrTopSpace, 0);
394subpageWidth = Math.Max(1, subpageWidth - (mbp.MBPLeft + mbp.MBPRight));
466dvrUsed = Math.Max(dvrUsed, fsbbox.fsrc.dv + fsbbox.fsrc.v);
467durTrack = Math.Max(durTrack, fsbbox.fsrc.du + fsbbox.fsrc.u);
477fsbbox.fsrc.du = Math.Max(durTrack - (mbp.MarginLeft + mbp.MarginRight), 0);
478fsbbox.fsrc.dv = Math.Max(dvrUsed - dvrTopSpace, 0);
563subpageWidth = Math.Max(1, subpageWidth - (mbp.MBPLeft + mbp.MBPRight));
634dvrUsed = Math.Max(dvrUsed, fsbbox.fsrc.dv + fsbbox.fsrc.v);
635durTrack = Math.Max(durTrack, fsbbox.fsrc.du + fsbbox.fsrc.u);
645fsbbox.fsrc.du = Math.Max(durTrack - (mbp.MarginLeft + mbp.MarginRight), 0);
646fsbbox.fsrc.dv = Math.Max(dvrUsed - dvrTopSpace, 0);
src\Framework\MS\Internal\PtsHost\TextParaClient.cs (9)
854int dcpStart = Math.Max(cpStartTextPointer, cpParagraphStart) - cpParagraphStart;
1597int countVisualsShiftBeforeChange = Math.Min(Math.Max(lineIndexToBeginRemoval - _lineIndexFirstVisual, 0), lineVisuals.Count);
1614int actualLinesToRemove = Math.Min(Math.Max(lineIndexToBeginRemoval - _lineIndexFirstVisual + cLinesToRemove, 0), lineVisuals.Count);
2088int dcpRangeStartForThisLine = Math.Max(lineDesc.dcpFirst, dcpStart);
2091int cchRangeForThisLine = Math.Max(Math.Min(lineDesc.dcpLim, dcpEnd) - dcpRangeStartForThisLine, 1);
2203int dcpRangeStartForThisElem = Math.Max(elemDesc.dcpFirst, dcpStart);
2206int cchRangeForThisElem = Math.Max(Math.Min(elemDesc.dcpLim, dcpEnd) - dcpRangeStartForThisElem, 1);
3381line.GetGlyphRuns(glyphRuns, Math.Max(dcpStart, lineDesc.dcpFirst), Math.Min(dcpEnd, lineDesc.dcpLim));
3448line.GetGlyphRuns(glyphRuns, Math.Max(dcpStart, element.dcpFirst), Math.Min(dcpEnd, element.dcpLim));