src\Framework\System\Windows\Controls\VirtualizingStackPanel.cs (57)
2309childConstraint.Width = Double.PositiveInfinity;
2315if (IsScrolling && CanHorizontallyScroll) { childConstraint.Width = Double.PositiveInfinity; }
3831_scrollData._extent.Width = distance;
3849pixelSize.Width = distance;
3871logicalSize.Width = distance;
5699stackPixelSize.Width += distance;
5710stackLogicalSize.Width += distance;
5747stackPixelSize.Width += childDesiredSize.Width;
5766stackPixelSize.Width += pixelDistance;
5935containerSize.Width = uniformSize;
5941containerSize.Width = IsPixelBased ? DesiredSize.Width : 1;
5965containerSize.Width = averageSize;
5971containerSize.Width = IsPixelBased ? DesiredSize.Width : 1;
6042containerSize.Width = uniformOrAverageContainerSize;
6045containerPixelSize.Width = uniformOrAverageContainerPixelSize;
6053containerSize.Width = IsPixelBased ? pixelWidth : 1;
6056containerPixelSize.Width = pixelWidth;
6774childLogicalSize.Width = Math.Max(itemDesiredSizes.LogicalSize.Width, logicalHeaderSize.Width);
6778childLogicalSize.Width = itemDesiredSizes.LogicalSize.Width + logicalHeaderSize.Width;
7155childPixelSizeInViewport.Width += pixelSizeInViewport;
7157childPixelSizeInCacheBeforeViewport.Width += pixelSizeBeforeViewport;
7159childPixelSizeInCacheAfterViewport.Width += pixelSizeAfterViewport;
7162childLogicalSizeInViewport.Width += logicalSizeInViewport;
7164childLogicalSizeInCacheBeforeViewport.Width += logicalSizeBeforeViewport;
7166childLogicalSizeInCacheAfterViewport.Width += logicalSizeAfterViewport;
7248childPixelSizeInViewport.Width = Math.Max(childPixelSizeInViewport.Width, childPixelWidthInViewport);
7250childPixelSizeInCacheBeforeViewport.Width = Math.Max(childPixelSizeInCacheBeforeViewport.Width, childPixelWidthInViewport);
7252childPixelSizeInCacheAfterViewport.Width = Math.Max(childPixelSizeInCacheAfterViewport.Width, childPixelWidthInViewport);
7255childLogicalSizeInViewport.Width = Math.Max(childLogicalSizeInViewport.Width, childLogicalSize.Width);
7257childLogicalSizeInCacheBeforeViewport.Width = Math.Max(childLogicalSizeInCacheBeforeViewport.Width, childLogicalSize.Width);
7259childLogicalSizeInCacheAfterViewport.Width = Math.Max(childLogicalSizeInCacheAfterViewport.Width, childLogicalSize.Width);
7301sz1.Width += sz2.Width;
7307sz1.Width = Math.Max(sz1.Width, sz2.Width);
8337previousChildSize.Width = itemDesiredSizes.PixelSizeInViewport.Width;
8341previousChildSize.Width += itemDesiredSizes.PixelSizeBeforeViewport.Width + itemDesiredSizes.PixelSizeAfterViewport.Width;
8348previousChildSize.Width += pixelHeaderSize.Width;
8352previousChildSize.Width = Math.Max(previousChildSize.Width, pixelHeaderSize.Width);
9486viewportSize.Width--;
9499viewportSize.Width = viewport.Width;
9540stackPixelSize.Width = _scrollData._extent.Width;
9547_scrollData._maxDesiredSize.Width = Math.Max(_scrollData._maxDesiredSize.Width, stackPixelSize.Width);
9548stackPixelSize.Width = _scrollData._maxDesiredSize.Width;
9550extentSize.Width = stackPixelSize.Width;
9554viewportSize.Width = stackPixelSize.Width;
9572stackPixelSize.Width = IsPixelBased || DoubleUtil.AreClose(computedViewportOffset.X, 0) ?
9860viewportSize.Width = proposedViewportSize;
9887viewportSize.Width = _scrollData._viewport.Width;
10338viewportSize.Width--;
10351viewportSize.Width = viewport.Width;
10392stackPixelSize.Width = _scrollData._extent.Width;
10399_scrollData._maxDesiredSize.Width = Math.Max(_scrollData._maxDesiredSize.Width, stackPixelSize.Width);
10400stackPixelSize.Width = _scrollData._maxDesiredSize.Width;
10402extentSize.Width = stackPixelSize.Width;
10406viewportSize.Width = stackPixelSize.Width;
10424stackPixelSize.Width = IsPixelBased || DoubleUtil.AreClose(computedViewportOffset.X, 0) ?
10533viewportSize.Width = proposedViewportSize;
10552viewportSize.Width = _scrollData._viewport.Width;
src\Framework\MS\Internal\AppModel\IconHelper.cs (11)
137|| bf.PixelWidth == size.Width && bf.PixelHeight == size.Height;
159var drawingDimensions = new Rect(0, 0, renderSize.Width, renderSize.Height);
162double renderRatio = renderSize.Width / renderSize.Height;
166if (img.Width <= renderSize.Width && img.Height <= renderSize.Height)
168drawingDimensions = new Rect((renderSize.Width - img.Width) / 2, (renderSize.Height - img.Height) / 2, img.Width, img.Height);
172double scaledRenderWidth = (img.Width / img.Height) * renderSize.Width;
173drawingDimensions = new Rect((renderSize.Width - scaledRenderWidth) / 2, 0, scaledRenderWidth, renderSize.Height);
178drawingDimensions = new Rect(0, (renderSize.Height - scaledRenderHeight) / 2, renderSize.Width, scaledRenderHeight);
188var bmp = new RenderTargetBitmap((int)renderSize.Width, (int)renderSize.Height, 96, 96, PixelFormats.Pbgra32);
443MyAbs(frame.PixelWidth, (int)size.Width, true) +
475Invariant.Assert(size.Width != 0, "input param width should not be zero");
src\Framework\MS\Internal\Documents\TextBoxView.cs (27)
432bool widthChanged = !DoubleUtil.AreClose(constraint.Width, _previousConstraint.Width);
479desiredSize = FullMeasureTick(safeConstraint.Width, lineProperties);
483desiredSize = IncrementalMeasure(safeConstraint.Width, lineProperties);
489double oldWidth = _contentSize.Width;
494if (oldWidth != desiredSize.Width && lineProperties.TextAlignment != TextAlignment.Left)
504desiredSize.Width = Math.Min(constraint.Width, desiredSize.Width);
541context.DrawRectangle(new SolidColorBrush(Color.FromArgb(0, 0, 0, 0)), null, new Rect(0, 0, this.RenderSize.Width, this.RenderSize.Height));
793suggestedX -= GetTextAlignmentCorrection(this.CalculatedTextAlignment, GetWrappingWidth(this.RenderSize.Width));
1564double width = GetWrappingWidth(this.RenderSize.Width);
1565double formatWidth = GetWrappingWidth(_previousConstraint.Width);
1739double width = GetWrappingWidth(this.RenderSize.Width);
1740double formatWidth = GetWrappingWidth(_previousConstraint.Width);
1849double width = GetWrappingWidth(arrangeSize.Width);
1869double formatWidth = GetWrappingWidth(_previousConstraint.Width);
2015point.X -= GetTextAlignmentCorrection(this.CalculatedTextAlignment, GetWrappingWidth(this.RenderSize.Width));
2033rect.X += GetTextAlignmentCorrection(this.CalculatedTextAlignment, GetWrappingWidth(this.RenderSize.Width));
2277desiredSize.Width = Math.Max(desiredSize.Width, line.Width);
2647desiredSize.Width = Math.Max(desiredSize.Width, _lineMetrics[i].Width);
2846double width = GetWrappingWidth(this.RenderSize.Width);
2910if (width < _contentSize.Width)
2912width = _contentSize.Width;
2915if (width > _previousConstraint.Width)
2917width = _previousConstraint.Width;
2940_contentSize.Width > width)
2942correction = -GetContentOffset(_contentSize.Width, textAlignment);
src\Framework\MS\Internal\Documents\TextDocumentView.cs (5)
3337MatrixTransform transform = new MatrixTransform(-1.0, 0.0, 0.0, 1.0, _owner.Size.Width, 0.0);
3355MatrixTransform transform = new MatrixTransform(-1.0, 0.0, 0.0, 1.0, _owner.Size.Width, 0.0);
3381transform = new MatrixTransform(-1.0, 0.0, 0.0, 1.0, _owner.Size.Width, 0.0);
3399MatrixTransform transform = new MatrixTransform(-1.0, 0.0, 0.0, 1.0, _owner.Size.Width, 0.0);
3417MatrixTransform transform = new MatrixTransform(-1.0, 0.0, 0.0, 1.0, _owner.Size.Width, 0.0);
src\Framework\MS\Internal\PtsHost\FlowDocumentPage.cs (6)
138if(!DoubleUtil.AreClose(_lastFormatWidth, pageSize.Width) || !DoubleUtil.AreClose(_pageMargin.Left, pageMargin.Left) ||
145_lastFormatWidth = pageSize.Width;
168SetContentBox(new Rect(pageMargin.Left, pageMargin.Top, _ptsPage.CalculatedSize.Width, _ptsPage.CalculatedSize.Height));
197double pageMarginAdjustment = PtsHelper.CalculatePageMarginAdjustment(_structuralCache, pageSize.Width - (pageMargin.Left + pageMargin.Right));
207pageSize.Width - (pageMargin.Left + pageMargin.Right),
900PtsHelper.UpdateMirroringTransform(FlowDirection.LeftToRight, flowdirection, pageVisual, Size.Width);
src\Framework\MS\Internal\PtsHost\Section.cs (3)
116durPage = TextDpi.ToTextDpi(pageSize.Width);
235ccol = PtsHelper.CalculateColumnCount(columnProperties, lineHeight, pageSize.Width - (pageMargin.Left + pageMargin.Right), pageFontSize, pageFontFamily, enableColumns);
381PtsHelper.GetColumnsInfo(columnProperties, lineHeight, pageSize.Width - (pageMargin.Left + pageMargin.Right), pageFontSize, pageFontFamily, ncol, pfscolinfo, enableColumns);
src\Framework\System\Windows\Controls\Border.cs (16)
238Size combined = new Size(border.Width + padding.Width, border.Height + padding.Height);
241Size childConstraint = new Size(Math.Max(0.0, constraint.Width - combined.Width),
249mySize.Width = childSize.Width + combined.Width;
255mySize = new Size(border.Width + padding.Width, border.Height + padding.Height);
444new Point(RenderSize.Width - halfThickness, RenderSize.Height - halfThickness));
504new Point(RenderSize.Width - halfThickness, 0),
505new Point(RenderSize.Width - halfThickness, RenderSize.Height));
537new Point(RenderSize.Width, halfThickness));
567new Point(RenderSize.Width, RenderSize.Height - halfThickness));
586ptBR = new Point(UIElement.RoundLayoutValue(RenderSize.Width - border.Right, dpi.DpiScaleX),
591ptBR = new Point(RenderSize.Width - UIElement.RoundLayoutValue(border.Right, dpi.DpiScaleX),
598ptBR = new Point(RenderSize.Width - border.Right, RenderSize.Height - border.Bottom);
src\Framework\System\Windows\Controls\Primitives\BulletDecorator.cs (11)
205new Rect(0, 0, RenderSize.Width, RenderSize.Height));
258contentConstraint.Width = Math.Max(0.0, contentConstraint.Width - bulletSize.Width);
264Size desiredSize = new Size(bulletSize.Width + contentSize.Width, Math.Max(bulletSize.Height, contentSize.Height));
290contentOffsetX = bulletSize.Width;
301contentSize.Width = Math.Max(content.DesiredSize.Width, arrangeSize.Width - bullet.DesiredSize.Width);
304content.Arrange(new Rect(contentOffsetX, 0, contentSize.Width, contentSize.Height));
313bullet.Arrange(new Rect(0, bulletOffsetY, bullet.DesiredSize.Width, bullet.DesiredSize.Height));
src\Framework\System\Windows\Controls\Primitives\DocumentPageView.cs (18)
241if (!Double.IsInfinity(availableSize.Width) || !Double.IsInfinity(availableSize.Height))
244if (Double.IsInfinity(availableSize.Width))
248newPageSize.Width = newPageSize.Height * (pageSize.Width / pageSize.Height); // Keep aspect ratio.
253newPageSize.Width = availableSize.Width / _pageZoom;
254newPageSize.Height = newPageSize.Width * (pageSize.Height / pageSize.Width); // Keep aspect ratio.
258newPageSize = new Size(availableSize.Width / _pageZoom, availableSize.Height / _pageZoom);
327pageSize = new Size(_documentPage.Size.Width * _pageZoom, _documentPage.Size.Height * _pageZoom);
329desiredSize = new Size(pageSize.Width * pageZoom.Width, pageSize.Height * pageZoom.Height);
400pageTransform = new MatrixTransform(-1.0, 0.0, 0.0, 1.0, pageSize.Width, 0.0);
415pageSize = new Size(pageSize.Width * _pageZoom, pageSize.Height * _pageZoom);
420if (!DoubleUtil.IsOne(pageZoom.Width) || !DoubleUtil.IsOne(pageZoom.Height))
422pageScaleTransform = new ScaleTransform(pageZoom.Width, pageZoom.Height);
431pageSize = new Size(pageSize.Width * pageZoom.Width, pageSize.Height * pageZoom.Height);
435_pageHost.CachedOffset = new Point((finalSize.Width - pageSize.Width) / 2, (finalSize.Height - pageSize.Height) / 2);
src\Framework\System\Windows\Controls\Primitives\ToolBarOverflowPanel.cs (20)
65_wrapWidth = double.IsNaN(WrapWidth) ? constraint.Width : WrapWidth;
116if (DoubleUtil.GreaterThan(childDesiredSize.Width, _wrapWidth))
118_wrapWidth = childDesiredSize.Width;
123_wrapWidth = Math.Min(_wrapWidth, constraint.Width);
130if (DoubleUtil.GreaterThan(curLineSize.Width + sz.Width, _wrapWidth)) //need to switch to another line
132_panelSize.Width = Math.Max(curLineSize.Width, _panelSize.Width);
136if (DoubleUtil.GreaterThan(sz.Width, _wrapWidth)) //the element is wider then the constraint - give it a separate line
138_panelSize.Width = Math.Max(sz.Width, _panelSize.Width);
145curLineSize.Width += sz.Width;
151_panelSize.Width = Math.Max(curLineSize.Width, _panelSize.Width);
167_wrapWidth = Math.Min(_wrapWidth, arrangeBounds.Width);
174if (DoubleUtil.GreaterThan(curLineSize.Width + sz.Width, _wrapWidth)) //need to switch to another line
186curLineSize.Width += sz.Width;
214child.Arrange(new Rect(x, y, child.DesiredSize.Width, lineHeight));
215x += child.DesiredSize.Width;
src\Framework\System\Windows\Controls\Slider.cs (12)
947new Point((targetSize.Width - popupSize.Width) * 0.5, -popupSize.Height),
956new Point(-popupSize.Width, (targetSize.Height - popupSize.Height) * 0.5),
967new Point((targetSize.Width - popupSize.Width) * 0.5, targetSize.Height) ,
977new Point(targetSize.Width, (targetSize.Height - popupSize.Height) * 0.5),
1017if (DoubleUtil.AreClose(range, 0d) || (DoubleUtil.AreClose(trackSize.Width, thumbSize.Width)))
1023valueToSize = Math.Max(0.0, (trackSize.Width - thumbSize.Width) / range);
1029Canvas.SetLeft(rangeElement, (thumbSize.Width * 0.5) + Math.Max(Maximum - SelectionEnd, 0) * valueToSize);
1033Canvas.SetLeft(rangeElement, (thumbSize.Width * 0.5) + Math.Max(SelectionStart - Minimum, 0) * valueToSize);
src\Framework\System\Windows\Controls\TextBlock.cs (30)
1290bypassMeasure = DoubleUtil.AreClose(constraint.Width, _referenceSize.Width) || (lineProperties.TextWrapping == TextWrapping.NoWrap);
1295DoubleUtil.AreClose(constraint.Width, _referenceSize.Width) &&
1353Size contentSize = new Size(Math.Max(0.0, constraint.Width - (padding.Left + padding.Right)),
1365line.Format(dcp, contentSize.Width, GetLineProperties(dcp == 0, lineProperties), textLineBreakIn, _textBlockCache._textRunCache, /*Show paragraph ellipsis*/ false);
1393desiredSize.Width = Math.Max(desiredSize.Width, line.GetCollapsedWidth());
1492double wrappingWidth = CalcWrappingWidth(arrangeSize.Width);
1588ctx.DrawRectangle(background, null, new Rect(0, 0, RenderSize.Width, RenderSize.Height));
1600double wrappingWidth = CalcWrappingWidth(RenderSize.Width);
1761double wrappingWidth = CalcWrappingWidth(RenderSize.Width);
1892double wrappingWidth = CalcWrappingWidth(RenderSize.Width);
2067Size contentSize = new Size(Math.Max(0.0, _referenceSize.Width - (padding.Left + padding.Right)),
2142double wrappingWidth = CalcWrappingWidth(RenderSize.Width);
2179double wrappingWidth = CalcWrappingWidth(RenderSize.Width);
2224double wrappingWidth = CalcWrappingWidth(RenderSize.Width);
2280double wrappingWidth = CalcWrappingWidth(RenderSize.Width);
2381double wrappingWidth = CalcWrappingWidth(RenderSize.Width);
2509double wrappingWidth = CalcWrappingWidth(RenderSize.Width);
2594double wrappingWidth = CalcWrappingWidth(RenderSize.Width);
2702double wrappingWidth = CalcWrappingWidth(RenderSize.Width);
3206Size contentSize = new Size(Math.Max(0.0, computedSize.Width - (padding.Left + padding.Right)),
3212contentOffset.X = contentSize.Width - wrappingWidth;
3216contentOffset.X = (contentSize.Width - wrappingWidth) / 2;
3274if (width < _previousDesiredSize.Width)
3276width = _previousDesiredSize.Width;
3278if (width > _referenceSize.Width)
3280width = _referenceSize.Width;
3283bool usingReferenceWidth = DoubleUtil.AreClose(width, _referenceSize.Width);
3411double wrappingWidth = CalcWrappingWidth(RenderSize.Width);
src\Framework\System\Windows\Controls\VirtualizingStackPanel.cs (297)
574_scrollData._offset.X = ScrollContentPresenter.CoerceOffset(scrollX, _scrollData._extent.Width, _scrollData._viewport.Width);
934_scrollData._extent.Width - _scrollData._viewport.Width);
982if (DoubleUtil.LessThan(expectedOffset, 0) || DoubleUtil.GreaterThan(expectedOffset, _scrollData._extent.Width - _scrollData._viewport.Width))
984Debug.Assert(DoubleUtil.AreClose(actualOffset, 0) || DoubleUtil.AreClose(actualOffset, _scrollData._extent.Width - _scrollData._viewport.Width), "The actual offset should already be at the beginning or the end.");
1298firstContainerOffsetFromViewport += virtualizingElement.HeaderDesiredSizes.LogicalSize.Width;
1492newOffset.X = ScrollContentPresenter.CoerceOffset(newOffset.X, _scrollData._extent.Width, _scrollData._viewport.Width);
1822return _scrollData._extent.Width;
1846return _scrollData._viewport.Width;
2581double newContainerSpan = isHorizontal ? newContainerSize.Width : newContainerSize.Height;
2972viewport.Width = stackPixelSize.Width;
3328arrangeLength = Math.Max(isHorizontal ? arrangeSize.Height : arrangeSize.Width, arrangeLength);
3900((isHorizontal && DoubleUtil.GreaterThanOrClose(DesiredSize.Width, PreviousConstraint.Width)) ||
4266viewport = new Rect(offsetX, offsetY, size.Width, size.Height);
4271viewport = new Rect(offsetX, offsetY, viewportSize.Width, viewportSize.Height);
4503viewport = new Rect(0, 0, constraint.Width, constraint.Height);
4648double approxSizeOfLogicalUnit = (DoubleUtil.GreaterThan(_previousStackPixelSizeInViewport.Width, 0.0) && DoubleUtil.GreaterThan(_previousStackLogicalSizeInViewport.Width, 0.0)) ?
4649_previousStackPixelSizeInViewport.Width / _previousStackLogicalSizeInViewport.Width : ScrollViewer._scrollLineDelta;
4651pixelSize = stackPixelSize.Width;
4652logicalSize = stackLogicalSize.Width;
4656pixelSizeBeforeViewport = stackPixelSizeInCacheBeforeViewport.Width;
4657pixelSizeAfterViewport = stackPixelSizeInCacheAfterViewport.Width;
4658logicalSizeBeforeViewport = stackLogicalSizeInCacheBeforeViewport.Width;
4659logicalSizeAfterViewport = stackLogicalSizeInCacheAfterViewport.Width;
4710if (DoubleUtil.GreaterThan(extendedViewport.X + extendedViewport.Width, _scrollData._extent.Width))
4712extendedViewport.Width = _scrollData._extent.Width - extendedViewport.X;
4745if (DoubleUtil.GreaterThan(extendedViewport.X + extendedViewport.Width / approxSizeOfLogicalUnit, _scrollData._extent.Width))
4747extendedViewport.Width = (_scrollData._extent.Width - extendedViewport.X) * approxSizeOfLogicalUnit;
4880viewport.X = ScrollContentPresenter.CoerceOffset(viewport.X, extent.Width, viewport.Width);
4881if (!IsPixelBased && isHorizontal && DoubleUtil.IsZero(viewport.Width) && DoubleUtil.AreClose(viewport.X, extent.Width))
4883viewport.X = ScrollContentPresenter.CoerceOffset(viewport.X - 1, extent.Width, viewport.Width);
4961viewport.X -= IsPixelBased ? pixelSize.Width : logicalSize.Width;
4969if (IsPixelBased && DoubleUtil.GreaterThan(pixelSize.Width, parentViewport.X))
4975sizeAfterStartViewportEdge = pixelSize.Width - parentViewport.X;
4976sizeBeforeStartViewportEdge = pixelSize.Width - sizeAfterStartViewportEdge;
4986cacheBeforeSize = Math.Max(cacheBeforeSize - Math.Floor(logicalSize.Width * sizeBeforeStartViewportEdge / pixelSize.Width), 0);
5007if (DoubleUtil.GreaterThanOrClose(parentViewport.Width, pixelSize.Width))
5013viewport.Width = Math.Max(0, parentViewport.Width - pixelSize.Width);
5022sizeAfterEndViewportEdge = pixelSize.Width - sizeBeforeEndViewportEdge;
5032cacheAfterSize = Math.Max(cacheAfterSize - Math.Floor(logicalSize.Width * sizeAfterEndViewportEdge / pixelSize.Width), 0);
5044cacheAfterSize = Math.Max(cacheAfterSize - pixelSize.Width, 0);
5048cacheAfterSize = Math.Max(cacheAfterSize - logicalSize.Width, 0);
5491containerSpan = isHorizontal ? containerSize.Width : containerSize.Height;
5747stackPixelSize.Width += childDesiredSize.Width;
5832distance += containerSize.Width;
5888distance += containerSize.Width;
5889pixelDistance += containerPixelSize.Width;
5941containerSize.Width = IsPixelBased ? DesiredSize.Width : 1;
5971containerSize.Width = IsPixelBased ? DesiredSize.Width : 1;
6050double pixelWidth = DesiredSize.Width;
6087uniformOrAverageContainerSize = isHorizontal ? containerSize.Width : containerSize.Height;
6098areContainersUniformlySized = DoubleUtil.AreClose(containerSize.Width, uniformOrAverageContainerSize);
6138uniformOrAverageContainerSize = isHorizontal ? containerSize.Width : containerSize.Height;
6139uniformOrAverageContainerPixelSize = isHorizontal ? containerPixelSize.Width : containerPixelSize.Height;
6161areContainersUniformlySized = DoubleUtil.AreClose(containerSize.Width, uniformOrAverageContainerSize)
6162&& (ignoreContainerPixelSize || DoubleUtil.AreClose(containerPixelSize.Width, uniformOrAverageContainerPixelSize));
6198oldSpan = (oldValue != null) ? oldSize.Width : uniformOrAverageContainerSize;
6199newSpan = containerSize.Width;
6230oldSpan = (oldValue != null) ? oldCSD.ItemSize.Width : uniformOrAverageContainerSize;;
6231newSpan = containerSize.Width;
6301inset.Left = headerDesiredSizes.PixelSize.Width + margin.Left;
6342double right = DoubleUtil.AreClose(itemsSize.Width, itemsRect.Right) ? 0 : itemsRect.Right-itemsSize.Width;
6503return DoubleUtil.GreaterThanOrClose(stackLogicalSizeInCache.Width, cacheSize);
6514return DoubleUtil.GreaterThanOrClose(stackPixelSizeInCache.Width, cacheSize);
6528return DoubleUtil.GreaterThanOrClose(stackPixelSizeInViewport.Width, viewport.Width);
6590childViewport.X = (IsPixelBased ? stackPixelSizeInCacheBeforeViewport.Width : stackLogicalSizeInCacheBeforeViewport.Width) + containerSize.Width;
6596(IsPixelBased ? stackPixelSizeInViewport.Width + stackPixelSizeInCacheAfterViewport.Width :
6597stackLogicalSizeInViewport.Width + stackLogicalSizeInCacheAfterViewport.Width);
6598childViewport.Width = Math.Max(childViewport.Width - stackPixelSizeInViewport.Width, 0.0);
6603childViewport.Width = Math.Max(childViewport.Width - stackPixelSizeInViewport.Width, 0.0);
6611Math.Max(parentCacheSize.CacheBeforeViewport - stackLogicalSizeInCacheBeforeViewport.Width, 0.0),
6614Math.Max(parentCacheSize.CacheAfterViewport - stackLogicalSizeInCacheAfterViewport.Width, 0.0));
6622Math.Max(parentCacheSize.CacheBeforeViewport - stackPixelSizeInCacheBeforeViewport.Width, 0.0),
6625Math.Max(parentCacheSize.CacheAfterViewport - stackPixelSizeInCacheAfterViewport.Width, 0.0));
6774childLogicalSize.Width = Math.Max(itemDesiredSizes.LogicalSize.Width, logicalHeaderSize.Width);
6778childLogicalSize.Width = itemDesiredSizes.LogicalSize.Width + logicalHeaderSize.Width;
6783((isHorizontal && DoubleUtil.AreClose(itemDesiredSizes.PixelSize.Width, itemDesiredSizes.PixelSizeInViewport.Width)) ||
6877childLogicalSize = new Size(DoubleUtil.GreaterThan(childPixelSize.Width, 0) ? 1 : 0,
6883childLogicalSizeInCacheBeforeViewport = new Size(DoubleUtil.GreaterThan(childPixelSizeInCacheBeforeViewport.Width, 0) ? 1 : 0,
6889childLogicalSizeInCacheAfterViewport = new Size(DoubleUtil.GreaterThan(childPixelSizeInCacheAfterViewport.Width, 0) ? 1 : 0,
6958( isHorizontal && (itemDesiredSizes.PixelSize.Width > 0 ||
6959itemDesiredSizes.LogicalSize.Width > 0)))
6979: new Size(childDesiredSize.Width, Math.Max(inset.Top, 0));
6993: new Size(childDesiredSize.Width, Math.Max(inset.Bottom,0));
7004adjustedChildViewport.X -= IsPixelBased ? frontPixelSize.Width + itemDesiredSizes.PixelSize.Width
7005: frontLogicalSize.Width + itemDesiredSizes.LogicalSize.Width;
7006adjustedChildViewport.Width = Math.Max(0, adjustedChildViewport.Width - childPixelSizeInViewport.Width);
7032childLogicalSizeInCacheBeforeViewport = new Size(DoubleUtil.GreaterThan(childPixelSizeInCacheBeforeViewport.Width, 0) ? 1 : 0,
7038childLogicalSizeInCacheAfterViewport = new Size(DoubleUtil.GreaterThan(childPixelSizeInCacheAfterViewport.Width, 0) ? 1 : 0,
7097pixelSizeBeforeViewport = DoubleUtil.LessThan(childViewport.X, childPixelSize.Width) ? Math.Max(childViewport.X, 0.0) : childPixelSize.Width;
7098pixelSizeInViewport = Math.Min(childViewport.Width, childPixelSize.Width - pixelSizeBeforeViewport);
7099pixelSizeAfterViewport = Math.Max(childPixelSize.Width - pixelSizeInViewport - pixelSizeBeforeViewport, 0.0); // Please note that due to rounding errors this subtraction can lead to negative values. Hence the Math.Max call
7115if (DoubleUtil.GreaterThanOrClose(childViewport.X, childLogicalSize.Width))
7117pixelSizeBeforeViewport = childPixelSize.Width;
7120logicalSizeBeforeViewport = childLogicalSize.Width;
7127pixelSizeInViewport = childPixelSize.Width;
7131pixelSizeAfterViewport = childPixelSize.Width;
7134logicalSizeAfterViewport = childLogicalSize.Width;
7140Debug.Assert(DoubleUtil.AreClose(pixelSizeInViewport + pixelSizeBeforeViewport + pixelSizeAfterViewport, childPixelSize.Width), "The computed sizes within and outside the viewport should add up to the childPixelSize.");
7142if (DoubleUtil.GreaterThan(childPixelSize.Width, 0.0))
7144logicalSizeBeforeViewport = Math.Floor(childLogicalSize.Width * pixelSizeBeforeViewport / childPixelSize.Width);
7145logicalSizeAfterViewport = Math.Floor(childLogicalSize.Width * pixelSizeAfterViewport / childPixelSize.Width);
7146logicalSizeInViewport = childLogicalSize.Width - logicalSizeBeforeViewport - logicalSizeAfterViewport;
7150logicalSizeInViewport = childLogicalSize.Width - logicalSizeBeforeViewport - logicalSizeAfterViewport;
7182if (DoubleUtil.GreaterThanOrClose(childViewport.X, childPixelSize.Width) ||
7200if (DoubleUtil.GreaterThanOrClose(childViewport.X, childLogicalSize.Width) ||
7245double childPixelWidthInViewport = Math.Min(childViewport.Width, childPixelSize.Width - Math.Max(childViewport.X, 0.0));
7248childPixelSizeInViewport.Width = Math.Max(childPixelSizeInViewport.Width, childPixelWidthInViewport);
7250childPixelSizeInCacheBeforeViewport.Width = Math.Max(childPixelSizeInCacheBeforeViewport.Width, childPixelWidthInViewport);
7252childPixelSizeInCacheAfterViewport.Width = Math.Max(childPixelSizeInCacheAfterViewport.Width, childPixelWidthInViewport);
7255childLogicalSizeInViewport.Width = Math.Max(childLogicalSizeInViewport.Width, childLogicalSize.Width);
7257childLogicalSizeInCacheBeforeViewport.Width = Math.Max(childLogicalSizeInCacheBeforeViewport.Width, childLogicalSize.Width);
7259childLogicalSizeInCacheAfterViewport.Width = Math.Max(childLogicalSizeInCacheAfterViewport.Width, childLogicalSize.Width);
7301sz1.Width += sz2.Width;
7307sz1.Width = Math.Max(sz1.Width, sz2.Width);
7357childSize = new Size(Math.Max(headerDesiredSizes.PixelSize.Width, itemDesiredSizes.PixelSize.Width),
7362childSize = new Size(Math.Max(headerDesiredSizes.LogicalSize.Width, itemDesiredSizes.LogicalSize.Width),
7374childSize = new Size(DoubleUtil.GreaterThan(child.DesiredSize.Width, 0) ? 1 : 0,
7383computedAreContainersUniformlySized = DoubleUtil.AreClose(childSize.Width, uniformOrAverageContainerSize);
7427sumOfContainerSizes += containerSize.Width;
7512childPixelSize = new Size(inset.Left + itemDesiredSizes.PixelSize.Width + inset.Right,
7529childSize = isHorizontal ? new Size(1 + itemDesiredSizes.LogicalSize.Width,
7531: new Size(Math.Max(1, itemDesiredSizes.LogicalSize.Width),
7545childSize = new Size(DoubleUtil.GreaterThan(child.DesiredSize.Width, 0) ? 1 : 0,
7554computedAreContainersUniformlySized = DoubleUtil.AreClose(childSize.Width, uniformOrAverageContainerSize)
7555&& (IsPixelBased || DoubleUtil.AreClose(childPixelSize.Width, uniformOrAverageContainerPixelSize));
7646sumOfContainerSizes += containerSize.Width;
7647sumOfContainerPixelSizes += containerPixelSize.Width;
8278((IsVSP45Compat || !IsVirtualizing || !HasVirtualizingChildren) ? _previousStackPixelSizeInCacheBeforeViewport.Width : _pixelDistanceToViewport);
8326rcChild.Width = childDesiredSize.Width;
8337previousChildSize.Width = itemDesiredSizes.PixelSizeInViewport.Width;
8341previousChildSize.Width += itemDesiredSizes.PixelSizeBeforeViewport.Width + itemDesiredSizes.PixelSizeAfterViewport.Width;
8348previousChildSize.Width += pixelHeaderSize.Width;
8352previousChildSize.Width = Math.Max(previousChildSize.Width, pixelHeaderSize.Width);
8359rcChild.Width = Math.Max(arrangeLength, childDesiredSize.Width);
8412rcChild.X += previousChildSize.Width;
8413rcChild.Width = childDesiredSize.Width;
8420rcChild.Width = Math.Max(arrangeLength, childDesiredSize.Width);
8457rcChild.Width = childDesiredSize.Width;
8500rcChild.X -= childDesiredSize.Width;
8504rcChild.X += previousChildSize.Width;
8511rcChild.Width = Math.Max(arrangeLength, childDesiredSize.Width);
9483if (DoubleUtil.GreaterThan(stackPixelSizeInViewport.Width, constraint.Width) &&
9484viewportSize.Width > 1)
9540stackPixelSize.Width = _scrollData._extent.Width;
9547_scrollData._maxDesiredSize.Width = Math.Max(_scrollData._maxDesiredSize.Width, stackPixelSize.Width);
9548stackPixelSize.Width = _scrollData._maxDesiredSize.Width;
9550extentSize.Width = stackPixelSize.Width;
9552if (Double.IsPositiveInfinity(constraint.Width))
9554viewportSize.Width = stackPixelSize.Width;
9570if (!Double.IsPositiveInfinity(constraint.Width))
9573Math.Min(stackPixelSize.Width, constraint.Width) : constraint.Width;
9621(IsScrollActive && computedViewportOffset.X > 0.0 && DoubleUtil.GreaterThanOrClose(computedViewportOffset.X, _scrollData.Extent.Width-_scrollData.Viewport.Width)))
9628(IsScrollActive && computedViewportOffset.X > 0.0 && DoubleUtil.GreaterThanOrClose(computedViewportOffset.X, _scrollData.Extent.Width-_scrollData.Viewport.Width)));
9660if (DoubleUtil.GreaterThan(newOffset + viewportSize.Width, extentSize.Width))
9698!DoubleUtil.AreClose(isHorizontal ? stackPixelSizeInViewport.Width : stackPixelSizeInViewport.Height,
9731extentWidthChanged = !DoubleUtil.AreClose(extentSize.Width, _scrollData._extent.Width);
9778Visibility newhv = DoubleUtil.LessThanOrClose(extentSize.Width, viewportSize.Width) ? Visibility.Collapsed : Visibility.Visible;
9834DoubleUtil.GreaterThan(stackLogicalSize.Width, stackLogicalSizeInViewport.Width))
9843lastPagePixelSize = stackPixelSizeInViewport.Width;
9846double approxSizeOfLogicalUnit = stackPixelSizeInViewport.Width / stackLogicalSizeInViewport.Width;
9848if (DoubleUtil.GreaterThan(proposedViewportSize, viewportSize.Width))
9854"pxSz:", stackPixelSizeInViewport.Width, viewport.Width,
9855"itSz:", stackLogicalSizeInViewport.Width, viewportSize.Width,
9871!DoubleUtil.AreClose(_scrollData._viewport.Width, viewportSize.Width))
9877"vpSz:", _scrollData._viewport.Width, viewportSize.Width,
9885if (DoubleUtil.AreClose(viewportSize.Width, 0))
9887viewportSize.Width = _scrollData._viewport.Width;
9903DoubleUtil.GreaterThan(computedViewportOffset.X, extentSize.Width - viewportSize.Width)))
9909"ext:", _scrollData._extent.Width, extentSize.Width,
9910"vpSz:", viewportSize.Width);
9926if (!DoubleUtil.AreClose(_scrollData._extent.Width, 0) &&
9927!DoubleUtil.AreClose(extentSize.Width, 0))
9931if (!LayoutDoubleUtil.AreClose(computedViewportOffset.X/extentSize.Width, _scrollData._offset.X/_scrollData._extent.Width))
9934viewportOffset.X = (extentSize.Width * _scrollData._offset.X) / _scrollData._extent.Width;
9940if (!LayoutDoubleUtil.AreClose(Math.Floor(computedViewportOffset.X)/extentSize.Width, Math.Floor(_scrollData._offset.X)/_scrollData._extent.Width))
9943viewportOffset.X = Math.Floor((extentSize.Width * Math.Floor(_scrollData._offset.X)) / _scrollData._extent.Width);
9951"expRat:", _scrollData._offset.X, _scrollData._extent.Width, (_scrollData._offset.X/_scrollData._extent.Width),
9952"actRat:", computedViewportOffset.X, extentSize.Width, (computedViewportOffset.X/extentSize.Width),
10186DoubleUtil.GreaterThan(computedViewportOffset.X, extentSize.Width - viewportSize.Width)))
10193"ext:", _scrollData._extent.Width, extentSize.Width,
10194"vpSz:", viewportSize.Width);
10209if (!DoubleUtil.AreClose(_scrollData._extent.Width, 0) &&
10210!DoubleUtil.AreClose(extentSize.Width, 0))
10212if (!LayoutDoubleUtil.AreClose(computedViewportOffset.X/extentSize.Width, _scrollData._offset.X/_scrollData._extent.Width))
10215viewportOffset.X = (extentSize.Width * _scrollData._offset.X) / _scrollData._extent.Width;
10222"expRat:", _scrollData._offset.X, _scrollData._extent.Width, (_scrollData._offset.X/_scrollData._extent.Width),
10223"actRat:", computedViewportOffset.X, extentSize.Width, (computedViewportOffset.X/extentSize.Width),
10335if (DoubleUtil.GreaterThan(stackPixelSizeInViewport.Width, constraint.Width) &&
10336viewportSize.Width > 1)
10392stackPixelSize.Width = _scrollData._extent.Width;
10399_scrollData._maxDesiredSize.Width = Math.Max(_scrollData._maxDesiredSize.Width, stackPixelSize.Width);
10400stackPixelSize.Width = _scrollData._maxDesiredSize.Width;
10402extentSize.Width = stackPixelSize.Width;
10404if (Double.IsPositiveInfinity(constraint.Width))
10406viewportSize.Width = stackPixelSize.Width;
10422if (!Double.IsPositiveInfinity(constraint.Width))
10425Math.Min(stackPixelSize.Width, constraint.Width) : constraint.Width;
10495Visibility newhv = DoubleUtil.LessThanOrClose(extentSize.Width, viewportSize.Width) ? Visibility.Collapsed : Visibility.Visible;
10520DoubleUtil.GreaterThan(stackLogicalSize.Width, stackLogicalSizeInViewport.Width))
10528double approxSizeOfLogicalUnit = stackPixelSizeInViewport.Width / stackLogicalSizeInViewport.Width;
10530if (DoubleUtil.GreaterThan(proposedViewportSize, viewportSize.Width))
10544!DoubleUtil.AreClose(_scrollData._viewport.Width, viewportSize.Width))
10550if (DoubleUtil.AreClose(viewportSize.Width, 0))
10552viewportSize.Width = _scrollData._viewport.Width;
10557if (!remeasure && extentSizeChanged && !DoubleUtil.AreClose(_scrollData._extent.Width, extentSize.Width))
10564DoubleUtil.GreaterThan(computedViewportOffset.X, extentSize.Width - viewportSize.Width))
10597!DoubleUtil.AreClose(_scrollData._extent.Width, 0) &&
10598!DoubleUtil.AreClose(extentSize.Width, 0))
10602if (!LayoutDoubleUtil.AreClose(computedViewportOffset.X/extentSize.Width, _scrollData._offset.X/_scrollData._extent.Width))
10605viewportOffset.X = (extentSize.Width * _scrollData._offset.X) / _scrollData._extent.Width;
10611if (!LayoutDoubleUtil.AreClose(Math.Floor(computedViewportOffset.X)/extentSize.Width, Math.Floor(_scrollData._offset.X)/_scrollData._extent.Width))
10614viewportOffset.X = Math.Floor((extentSize.Width * Math.Floor(_scrollData._offset.X)) / _scrollData._extent.Width);
10928offset += (isHorizontal ? desiredPixelHeaderSize.Width : desiredPixelHeaderSize.Height);
10941offset += (isHorizontal ? desiredLogicalHeaderSize.Width : desiredLogicalHeaderSize.Height);
11083viewportSize = (int)_scrollData._viewport.Width;
11151maxChildLength = Math.Max(maxChildLength, childSize.Width);
11642_viewport.Width == 0.0 &&
11644_extent.Width == 0.0 &&
11646_maxDesiredSize.Width == 0.0 &&
11736if (DoubleUtil.GreaterThanOrClose(newOffset, _extent.Width - _viewport.Width))
11740else if (DoubleUtil.GreaterThan(Math.Abs(newOffset - oldOffset), _viewport.Width))
12792writer.Write(size.Width);
src\Framework\System\Windows\FrameworkElement.cs (57)
3354return fe.RenderSize.Width;
3377return RenderSize.Width;
3964return new MatrixTransform(-1.0, 0.0, 0.0, 1.0, RenderSize.Width, 0.0);
4133Double xConstr = transformSpaceBounds.Width;
4343Math.Max(availableSize.Width - marginWidth, 0),
4392frameworkAvailableSize.Width = Math.Max(mm.minWidth, Math.Min(frameworkAvailableSize.Width, mm.maxWidth));
4406Math.Max(desiredSize.Width, mm.minWidth),
4419Rect unclippedBoundsTransformed = Rect.Transform(new Rect(0, 0, unclippedDesiredSize.Width, unclippedDesiredSize.Height), ltd.Transform.Value);
4429if (desiredSize.Width > mm.maxWidth)
4444Rect childBoundsTransformed = Rect.Transform(new Rect(0, 0, desiredSize.Width, desiredSize.Height), ltd.Transform.Value);
4452double clippedDesiredWidth = desiredSize.Width + marginWidth;
4458if (clippedDesiredWidth > availableSize.Width)
4460clippedDesiredWidth = availableSize.Width;
4510sb.Width = unclippedDesiredSize.Width;
4582arrangeSize.Width = Math.Max(0, arrangeSize.Width - marginWidth);
4591transformedUnroundedDS.Width = Math.Max(0, transformedUnroundedDS.Width - marginWidth);
4601unclippedDesiredSize = new Size(Math.Max(0, this.DesiredSize.Width - marginWidth),
4607unclippedDesiredSize.Width = Math.Max(transformedUnroundedDS.Width, unclippedDesiredSize.Width);
4616if (DoubleUtil.LessThan(arrangeSize.Width, unclippedDesiredSize.Width))
4619arrangeSize.Width = unclippedDesiredSize.Width;
4632arrangeSize.Width = unclippedDesiredSize.Width;
4655if (!DoubleUtil.IsZero(potentialArrangeSize.Width)
4659if (LayoutDoubleUtil.LessThan(potentialArrangeSize.Width, unclippedDesiredSize.Width)
4669if (DoubleUtil.LessThan(arrangeSize.Width, unclippedDesiredSize.Width))
4672arrangeSize.Width = unclippedDesiredSize.Width;
4695double effectiveMaxWidth = Math.Max(unclippedDesiredSize.Width, mm.maxWidth);
4696if (DoubleUtil.LessThan(effectiveMaxWidth, arrangeSize.Width))
4733Size clippedInkSize = new Size(Math.Min(innerInkSize.Width, mm.maxWidth),
4743DoubleUtil.LessThan(clippedInkSize.Width, innerInkSize.Width)
4749Rect inkRectTransformed = Rect.Transform(new Rect(0, 0, clippedInkSize.Width, clippedInkSize.Height), ltd.Transform.Value);
4776DoubleUtil.LessThan(clientSize.Width, clippedInkSize.Width)
4810NotifyPropertyChange(new DependencyPropertyChangedEventArgs(ActualWidthProperty, _actualWidthMetadata, sizeInfo.PreviousSize.Width, sizeInfo.NewSize.Width));
4832&& inkSize.Width > clientSize.Width)
4847offset.X = (clientSize.Width - inkSize.Width) * 0.5;
4851offset.X = clientSize.Width - inkSize.Width;
4906double maxWidthClip = (Double.IsPositiveInfinity(mm.maxWidth) ? inkSize.Width : mm.maxWidth);
4912|| (DoubleUtil.LessThan(maxWidthClip, inkSize.Width)
4916inkSize.Width = Math.Min(inkSize.Width, mm.maxWidth);
4924inkRectTransformed = Rect.Transform(new Rect(0, 0, inkSize.Width, inkSize.Height), ltd.Transform.Value);
4934Size clippingSize = new Size(Math.Max(0, layoutSlotSize.Width - marginWidth),
4939|| DoubleUtil.LessThan(clippingSize.Width, inkSize.Width)
4966clippingSize.Width,
5012clippingSize.Width,
5243double maxWidthClip = (Double.IsPositiveInfinity(mm.maxWidth) ? inkSize.Width : mm.maxWidth);
5247inkSize.Width = Math.Min(inkSize.Width, mm.maxWidth);
5298return new Point(renderSize.Width * relativeOrigin.X, renderSize.Height * relativeOrigin.Y);
src\Framework\System\Windows\Shell\WindowChromeWorker.cs (9)
1226double shortestDimension = Math.Min(windowSize.Width, windowSize.Height);
1242hrgn = _CreateRoundRectRgn(new Rect(0, 0, windowSize.Width / 2 + topLeftRadius, windowSize.Height / 2 + topLeftRadius), topLeftRadius);
1246Rect topRightRegionRect = new Rect(0, 0, windowSize.Width / 2 + topRightRadius, windowSize.Height / 2 + topRightRadius);
1247topRightRegionRect.Offset(windowSize.Width / 2 - topRightRadius, 0);
1248Assert.AreEqual(topRightRegionRect.Right, windowSize.Width);
1254Rect bottomLeftRegionRect = new Rect(0, 0, windowSize.Width / 2 + bottomLeftRadius, windowSize.Height / 2 + bottomLeftRadius);
1262Rect bottomRightRegionRect = new Rect(0, 0, windowSize.Width / 2 + bottomRightRadius, windowSize.Height / 2 + bottomRightRadius);
1263bottomRightRegionRect.Offset(windowSize.Width / 2 - bottomRightRadius, windowSize.Height / 2 - bottomRightRadius);
1264Assert.AreEqual(bottomRightRegionRect.Right, windowSize.Width);
src\Framework\System\Windows\Window.cs (22)
1873Size frameworkAvailableSize = new Size(availableSize.Width, availableSize.Height);
1877frameworkAvailableSize.Width = Math.Max(mm.minWidth, Math.Min(frameworkAvailableSize.Width, mm.maxWidth));
1885Math.Max(desiredSize.Width, mm.minWidth),
1907arrangeBounds.Width = Math.Max(mm.minWidth, Math.Min(arrangeBounds.Width, mm.maxWidth));
1942childArrangeBounds.Width = Math.Max(0.0, arrangeBounds.Width - frameSize.Width);
1955InternalSetLayoutTransform(child, new MatrixTransform(-1.0, 0.0, 0.0, 1.0, childArrangeBounds.Width, 0.0));
2783if ((!DoubleUtil.IsNaN(requestedWidth)) && (!DoubleUtil.AreClose(sizeDeviceUnits.Width, requestedSizeDeviceUnits.X)))
2854if (!Double.IsPositiveInfinity(maxSizeDeviceUnits.X) && (sizeDeviceUnits.Width > maxSizeDeviceUnits.X))
2866if (sizeDeviceUnits.Width < minSizeDeviceUnits.X)
2915DoubleUtil.DoubleToInt(sizeDeviceUnits.Width),
3494childConstraint.Width = ((constraint.Width == Double.PositiveInfinity) ? Double.PositiveInfinity : Math.Max(0.0, (constraint.Width - frameSize.Width)));
3499return new Size(childDesiredSize.Width + frameSize.Width, childDesiredSize.Height + frameSize.Height);
3933ownerSizeDeviceUnits = new Point(size.Width, size.Height);
3952leftDeviceUnits = ownerRectDeviceUnits.X + ((ownerRectDeviceUnits.Width - currentSizeDeviceUnits.Width) / 2);
3958leftDeviceUnits = Math.Min(leftDeviceUnits, workAreaRectDeviceUnits.right - currentSizeDeviceUnits.Width);
4037leftDeviceUnits = (workAreaRectDeviceUnits.left + ((workAreaWidthDeviceUnits - currentSizeDeviceUnits.Width) / 2));
5186(mousePositionWRTResizeGripControl.X > _resizeGripControl.RenderSize.Width) ||
6777Debug.Assert(0 != (int)_overlaySize.Width);