109 references to Round
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
HeartbeatTests.cs (1)
87
var roundedActualMs = Math.
Round
(actualMs / 50.0) * 50.0;
Microsoft.Extensions.Identity.Core (1)
AuthenticatorTokenProvider.cs (1)
63
var unixTimestamp = Convert.ToInt64(Math.
Round
((DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds));
PresentationCore (54)
MS\Internal\Shaping\CompositeFontFamily.cs (2)
126
return Math.
Round
(_fontInfo.Baseline * emSize);
157
return Math.
Round
(_fontInfo.LineSpacing * emSize);
MS\Internal\TextFormatting\LineServicesCallbacks.cs (8)
456
lstTextMetrics.dvAscent = (int)Math.
Round
(typeface.Baseline(store.Pap.EmSize, Constants.DefaultIdealToReal, store.Settings.TextSource.PixelsPerDip, fullText.TextFormattingMode));
457
lstTextMetrics.dvMultiLineHeight = (int)Math.
Round
(typeface.LineSpacing(store.Pap.EmSize, Constants.DefaultIdealToReal, store.Settings.TextSource.PixelsPerDip, fullText.TextFormattingMode));
715
ulInfo.dvpFirstUnderlineOffset = (int)Math.
Round
(lsrun.EmSize * -underlinePositionInEm);
716
ulInfo.dvpFirstUnderlineSize = (int)Math.
Round
(lsrun.EmSize * underlineThicknessInEm);
769
stInfo.dvpLowerStrikethroughOffset = (int)Math.
Round
(lsrun.EmSize * strikeThroughPositionInEm);
770
stInfo.dvpLowerStrikethroughSize = (int)Math.
Round
(lsrun.EmSize * strikeThroughThicknessInEm);
964
int baselineTop = ptOrigin.y + (int)Math.
Round
(lsrun.EmSize * strikeThroughPositionInEm);
965
int overlineTop = baselineTop - (lsrun.BaselineOffset - (int)Math.
Round
(lsrun.EmSize * strikeThroughThicknessInEm));
MS\Internal\TextFormatting\LineServicesRun.cs (2)
72
(shapeable != null ? (int)Math.
Round
(shapeable.Baseline * realToIdeal) : 0),
73
(shapeable != null ? (int)Math.
Round
(shapeable.Height * realToIdeal) : 0),
MS\Internal\TextFormatting\SimpleTextLine.cs (3)
335
_height = formatter.IdealToReal((int)Math.
Round
(pap.DefaultTypeface.LineSpacing(pap.EmSize, Constants.DefaultIdealToReal, PixelsPerDip, _settings.TextFormattingMode)), PixelsPerDip);
336
_baselineOffset = formatter.IdealToReal((int)Math.
Round
(pap.DefaultTypeface.Baseline(pap.EmSize, Constants.DefaultIdealToReal, PixelsPerDip, _settings.TextFormattingMode)), PixelsPerDip);
370
_idealOffsetUnRounded = (int)Math.
Round
((paragraphWidth - idealWidthAtTrailing) * 0.5);
MS\Internal\TextFormatting\TextFormatterImp.cs (1)
726
int value = (int)Math.
Round
(i * ToIdeal);
MS\Internal\TextFormatting\TextMetrics.cs (4)
205
_baselineOffset = (int)Math.
Round
(
216
_textAscent = (int)Math.
Round
(pap.DefaultTypeface.Baseline(pap.EmSize, Constants.DefaultIdealToReal, _pixelsPerDip, fullText.TextFormattingMode));
217
_textHeight = (int)Math.
Round
(pap.DefaultTypeface.LineSpacing(pap.EmSize, Constants.DefaultIdealToReal, _pixelsPerDip, fullText.TextFormattingMode));
268
_paragraphToText = (int)Math.
Round
((paragraphWidth + _textStart - _textWidthAtTrailing) * 0.5);
MS\Internal\TextFormatting\TextProperties.cs (1)
394
return (int)Math.
Round
(properties.FontRenderingEmSize * 0.75 * _textRunLength * realToIdeal);
MS\Internal\TextFormatting\TextRunCacheImp.cs (1)
206
looseCharLength = (int)Math.
Round
(TextStore.TypicalCharactersPerLine * 0.25);
MS\Internal\TextFormatting\TextStore.cs (2)
1579
(int)Math.
Round
(realToIdeal * runInfo.TextRun.Properties.FontRenderingEmSize),
1734
(int)Math.
Round
(realToIdeal * runInfo.TextRun.Properties.FontRenderingEmSize),
MS\Internal\TextFormatting\ThousandthOfEmRealDoubles.cs (1)
287
thousandthOfEm = (short) Math.
Round
(scaled);
System\Windows\Input\Stylus\Common\StylusPointCollection.cs (4)
533
output[x] = (int)Math.
Round
(stylusPoint.X * StrokeCollectionSerializer.AvalonToHimetricMultiplier);
534
output[x + 1] = (int)Math.
Round
(stylusPoint.Y * StrokeCollectionSerializer.AvalonToHimetricMultiplier);
602
output[0][b] = (int)Math.
Round
(stylusPoint.X * StrokeCollectionSerializer.AvalonToHimetricMultiplier);
603
output[1][b] = (int)Math.
Round
(stylusPoint.Y * StrokeCollectionSerializer.AvalonToHimetricMultiplier);
System\Windows\Input\Stylus\Pointer\PointerLogic.cs (4)
494
return new Point(Math.
Round
(pt.X), Math.
Round
(pt.Y));
510
return new Point(Math.
Round
(pt.X), Math.
Round
(pt.Y));
System\Windows\Input\Stylus\Pointer\PointerStylusPlugInManager.cs (2)
176
ptTablet.X = (int)Math.
Round
(ptTablet.X); // Make sure we snap to whole window pixels.
177
ptTablet.Y = (int)Math.
Round
(ptTablet.Y);
System\Windows\Input\Stylus\Pointer\PointerTabletDevice.cs (2)
138
_doubleTapSize = new Size((int)Math.
Round
((ScreenSize.Width * DoubleTapDelta) / dwXValue),
139
(int)Math.
Round
((ScreenSize.Height *DoubleTapDelta) / dwYValue));
System\Windows\Input\Stylus\Wisp\PenContexts.cs (2)
512
ptTablet.X = (int)Math.
Round
(ptTablet.X); // Make sure we snap to whole window pixels.
513
ptTablet.Y = (int)Math.
Round
(ptTablet.Y);
System\Windows\Input\Stylus\Wisp\WispLogic.cs (2)
3596
pt.X = (int)Math.
Round
(pt.X); // Make sure we return whole numbers (pixels are whole numbers)
3597
pt.Y = (int)Math.
Round
(pt.Y);
System\Windows\Input\Stylus\Wisp\WispTabletDevice.cs (4)
294
_cancelSize = new Size((int)Math.
Round
((ScreenSize.Width * stylusLogic.CancelDelta) / dwXValue),
295
(int)Math.
Round
((ScreenSize.Height * stylusLogic.CancelDelta) / dwYValue));
302
_doubleTapSize = new Size((int)Math.
Round
((ScreenSize.Width * stylusLogic.DoubleTapDelta) / dwXValue),
303
(int)Math.
Round
((ScreenSize.Height * stylusLogic.DoubleTapDelta) / dwYValue));
System\Windows\InterOp\HwndPointerInputProvider.cs (2)
336
originOffsetX = (int)Math.
Round
(originTabletCoord.X);
337
originOffsetY = (int)Math.
Round
(originTabletCoord.Y);
System\Windows\Media\GlyphsSerializer.cs (4)
198
int roundedShapingAdvance = (int)Math.
Round
(_idealAdvanceTotal + shapingAdvance - _currentAdvanceTotal);
199
int roundedFontAdvance = (int)Math.
Round
(fontAdvance);
220
int offset = (int)Math.
Round
(_offsets[glyph].X * _milToEm);
228
offset = (int)Math.
Round
(_offsets[glyph].Y * _milToEm);
System\Windows\Media\GlyphTypeface.cs (1)
1369
int missingGlyphWidth = (int)Math.
Round
(TextFormatterImp.RoundDip(emSize * GetAdvanceWidth(0, pixelsPerDip, textFormattingMode, isSideways), pixelsPerDip, textFormattingMode) * scalingFactor);
System\Windows\UIElement.cs (2)
1096
newValue = Math.
Round
(value * dpiScale) / dpiScale;
1107
newValue = Math.
Round
(value);
PresentationFramework (16)
Microsoft\Win32\CommonDialog.cs (2)
326
(int)Math.
Round
(x),
327
(int)Math.
Round
(y), // new X and Y positions
MS\Internal\Ink\PenCursorManager.cs (2)
220
int xHotspot = (int)Math.
Round
(hotspot.X - drawingBounds.Left);
221
int yHotspot = (int)Math.
Round
(hotspot.Y - drawingBounds.Top);
MS\Internal\Text\TextDpi.cs (1)
54
return (int)Math.
Round
(d * _scale);
System\Windows\Controls\GridSplitter.cs (2)
656
horizontalChange = Math.
Round
(horizontalChange / dragIncrement) * dragIncrement;
657
verticalChange = Math.
Round
(verticalChange / dragIncrement) * dragIncrement;
System\Windows\Controls\PopupControlService.cs (2)
1615
Debug.Assert(((int)pt.X == (int)Math.
Round
(pt2.X)) && ((int)pt.Y == (int)Math.
Round
(pt2.Y)), "got incorrect mouse point");
System\Windows\Controls\ScrollViewer.cs (2)
1830
Math.
Round
(PanningRatio * cumulativeTranslation / _panningInfo.DeltaPerHorizontalOffet));
1840
Math.
Round
(PanningRatio * cumulativeTranslation / _panningInfo.DeltaPerVerticalOffset));
System\Windows\Controls\Slider.cs (2)
1215
previous = Minimum + (Math.
Round
(((value - Minimum) / TickFrequency)) * TickFrequency);
1274
double tickNumber = Math.
Round
((value - Minimum) / TickFrequency);
System\Windows\Controls\VirtualizingStackPanel.cs (2)
7586
uniformOrAverageContainerSize = Math.
Round
(sumOfContainerSizes / numContainerSizes);
7822
uniformOrAverageContainerSize = Math.
Round
(sumOfContainerSizes / numContainerSizes);
System\Windows\Documents\XamlToRtfWriter.cs (1)
2893
formatState.FontSize = (long)Math.
Round
(fs);
ReachFramework (5)
AlphaFlattener\DrawingContext.cs (2)
606
int width = (int) Math.
Round
(bounds.Width * Configuration.RasterizationDPI / 96);
607
int height = (int) Math.
Round
(bounds.Height * Configuration.RasterizationDPI / 96);
AlphaFlattener\Optimizer.cs (2)
51
int width = (int)Math.
Round
(m_bounds.Width * Configuration.RasterizationDPI / 96);
52
int height = (int)Math.
Round
(m_bounds.Height * Configuration.RasterizationDPI / 96);
AlphaFlattener\Utility.cs (1)
161
double s = Math.
Round
(scale);
System.Data.Common (1)
System\Data\Common\TimeSpanStorage.cs (1)
129
ulong stDev = (ulong)Math.
Round
(Math.Sqrt(varSum / (count - 1)));
System.Drawing.Primitives (8)
System\Drawing\Point.cs (2)
133
public static Point Round(PointF value) => new Point(unchecked((int)Math.
Round
(value.X)), unchecked((int)Math.
Round
(value.Y)));
System\Drawing\Rectangle.cs (4)
212
(int)Math.
Round
(value.X),
213
(int)Math.
Round
(value.Y),
214
(int)Math.
Round
(value.Width),
215
(int)Math.
Round
(value.Height));
System\Drawing\Size.cs (2)
174
new Size(unchecked((int)Math.
Round
(value.Width)), unchecked((int)Math.
Round
(value.Height)));
System.Net.Ping (1)
src\libraries\Common\src\System\Net\NetworkInformation\UnixCommandLinePing.cs (1)
210
return (long)Math.
Round
(parsedRtt);
System.Net.Sockets (1)
System\Net\Sockets\SocketAsyncEngine.Unix.cs (1)
57
return Math.Max(1, (int)Math.
Round
(Environment.ProcessorCount / (double)coresPerEngine));
System.Private.CoreLib (13)
src\libraries\System.Private.CoreLib\src\System\Convert.cs (2)
1305
return checked((long)Math.
Round
(value));
1422
return checked((ulong)Math.
Round
(value));
src\libraries\System.Private.CoreLib\src\System\Decimal.DecCalc.cs (2)
1565
mant = (uint)(int)Math.
Round
(dbl);
1729
mant = (ulong)(long)Math.
Round
(dbl);
src\libraries\System.Private.CoreLib\src\System\Double.cs (1)
686
public static double Round(double x) => Math.
Round
(x);
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (4)
2713
if (!time.TryAddTicks((long)Math.
Round
(raw.fraction * Calendar.TicksPerSecond), out time))
3074
if (!time.TryAddTicks((long)Math.
Round
(partSecond * Calendar.TicksPerSecond), out time))
4742
if (!result.parsedDate.TryAddTicks((long)Math.
Round
(result.fraction * Calendar.TicksPerSecond), out result.parsedDate))
5087
if (!dateTime.TryAddTicks((long)Math.
Round
(fraction * Calendar.TicksPerSecond), out result.parsedDate))
src\libraries\System.Private.CoreLib\src\System\Math.cs (2)
819
double roundedResult =
Round
(divisionResult);
1319
return
Round
(value);
src\libraries\System.Private.CoreLib\src\System\TimeSpan.cs (2)
783
double ticks = Math.
Round
(timeSpan.Ticks * factor);
798
double ticks = Math.
Round
(timeSpan.Ticks / divisor);
System.Private.Xml (3)
System\Xml\XmlConvert.cs (1)
1105
double temp = Math.
Round
(value);
System\Xml\Xsl\Runtime\XslNumber.cs (1)
308
Debug.Assert(val >= 0 && val == Math.
Round
(val), "ConvertToArabic operates on non-negative integer numbers only");
System\Xml\Xsl\Runtime\XsltFunctions.cs (1)
209
double temp = Math.
Round
(value);
System.Windows.Input.Manipulations (1)
System\Windows\Input\Manipulations\ManipulationSequence.cs (1)
1347
int newHistoryLength = (int)Math.
Round
(smoothingLevel * MaxHistoryLength);
UIAutomationClientSideProviders (4)
MS\Internal\AutomationProxies\WindowsEditBoxRange.cs (1)
783
return Math.
Round
((double)(-logfont.lfHeight) * 72 / lpy);
MS\Internal\AutomationProxies\WindowsListView.cs (1)
1695
int future = (int) Math.
Round
(((si.nMax - deltaPage) - si.nMin) * fScrollPos / 100.0 + si.nMin);
MS\Internal\AutomationProxies\WindowsScroll.cs (1)
307
int newPos = (int) Math.
Round
(((si.nMax - delta) - si.nMin) * fScrollPos / 100.0 + si.nMin);
MS\Internal\AutomationProxies\WindowsTab.cs (1)
518
int newPos = (int) Math.
Round
((maxPos - minPos) * horizontalPercent / 100) + minPos;