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