From 6cc829a132dd41fd8541a5ad5485091108886d1e Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Sun, 5 Mar 2017 20:33:24 +0100 Subject: [PATCH] Renamed Rect.CenterIn -> CenterRect. The previous naming suggested that the `Rect` that the method was being called on was the one being centered. --- src/Avalonia.Controls/Image.cs | 4 ++-- src/Avalonia.Visuals/Rect.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Avalonia.Controls/Image.cs b/src/Avalonia.Controls/Image.cs index 43c8fbcbb4..f6f11aa9ad 100644 --- a/src/Avalonia.Controls/Image.cs +++ b/src/Avalonia.Controls/Image.cs @@ -63,10 +63,10 @@ namespace Avalonia.Controls Vector scale = Stretch.CalculateScaling(Bounds.Size, sourceSize); Size scaledSize = sourceSize * scale; Rect destRect = viewPort - .CenterIn(new Rect(scaledSize)) + .CenterRect(new Rect(scaledSize)) .Intersect(viewPort); Rect sourceRect = new Rect(sourceSize) - .CenterIn(new Rect(destRect.Size / scale)); + .CenterRect(new Rect(destRect.Size / scale)); context.DrawImage(source, 1, sourceRect, destRect); } diff --git a/src/Avalonia.Visuals/Rect.cs b/src/Avalonia.Visuals/Rect.cs index 0d6aadbcaa..8357400f33 100644 --- a/src/Avalonia.Visuals/Rect.cs +++ b/src/Avalonia.Visuals/Rect.cs @@ -238,7 +238,7 @@ namespace Avalonia /// /// The rectangle to center. /// The centered rectangle. - public Rect CenterIn(Rect rect) + public Rect CenterRect(Rect rect) { return new Rect( _x + ((_width - rect._width) / 2),