Skip to content

Commit

Permalink
wrong operator and fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tj-devel709 committed Jun 28, 2024
1 parent 0dd1a27 commit 99ed008
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Controls/src/Core/Button/Button.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ void LayoutButton(UIButton platformButton, Button button, Rect size)
var buttonWidthConstraint = button.WidthRequest == -1 ? size.Width : Math.Min(button.WidthRequest, size.Width);
var buttonHeightConstraint = button.HeightRequest == -1 ? size.Height : Math.Min(button.HeightRequest, size.Height);

var titleWidthConstraint = buttonWidthConstraint - (nfloat)padding.Left + (nfloat)padding.Right + ((nfloat)borderWidth * 2);
var titleHeightConstraint = buttonHeightConstraint - (nfloat)padding.Top + (nfloat)padding.Bottom + ((nfloat)borderWidth * 2);
var titleWidthConstraint = buttonWidthConstraint - (nfloat)padding.Left - (nfloat)padding.Right - ((nfloat)borderWidth * 2);
var titleHeightConstraint = buttonHeightConstraint - (nfloat)padding.Top - (nfloat)padding.Bottom - ((nfloat)borderWidth * 2);

var imageInsets = new UIEdgeInsets();
var titleInsets = new UIEdgeInsets();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static class ButtonExtensions
/// <param name="widthConstraint"></param>
/// <param name="heightConstraint"></param>
/// <returns>Returns the <see cref="CGRect"/> that contains the button's title.</returns>
/// <remarks>The <see cref="NSStringDrawingOptions.UsesDeviceMetrics"/> flag is useful for when there is truncation in the title so we will take the max width of the two bounding rects.</remarks>
/// <remarks>The <see cref="NSStringDrawingOptions.UsesDeviceMetrics"/> flag is useful for when there is truncation in the title so we will take the max width of the two bounding rects. The GetBoundingRect method does not always give a great representation of what characters will be visible on the button but will not be needed when the UIButton.Configuration API is implemented. </remarks>
internal static CGRect GetTitleBoundingRect(this UIButton platformButton, double widthConstraint, double heightConstraint)
{
if ((platformButton.CurrentAttributedTitle != null || platformButton.CurrentTitle != null)
Expand Down

0 comments on commit 99ed008

Please sign in to comment.