Skip to content

Commit

Permalink
whitespace issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-hawley authored and PureWeen committed May 21, 2024
1 parent 006b82f commit 13f106e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
38 changes: 19 additions & 19 deletions src/Core/src/Platform/iOS/MauiCheckBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,17 @@ UIImage CreateCheckBox(UIImage? check)
return image;
}
else {
UIGraphics.BeginImageContextWithOptions(new CGSize(DefaultSize, DefaultSize), false, 0);
var context = UIGraphics.GetCurrentContext();
context.SaveState();
UIGraphics.BeginImageContextWithOptions(new CGSize(DefaultSize, DefaultSize), false, 0);
var context = UIGraphics.GetCurrentContext();
context.SaveState();

RenderCheckMark(context, check);
RenderCheckMark(context, check);

context.RestoreState();
var img = UIGraphics.GetImageFromCurrentImageContext();
UIGraphics.EndImageContext();
context.RestoreState();
var img = UIGraphics.GetImageFromCurrentImageContext();
UIGraphics.EndImageContext();

return img;
return img;
}
}

Expand Down Expand Up @@ -251,21 +251,21 @@ static UIImage CreateCheckMark()

static void RenderCheckMark(CGContext context)
{
context.SaveState();
context.SaveState();

var vPadding = LineWidth / 2;
var hPadding = LineWidth / 2;
var diameter = DefaultSize - LineWidth;
var vPadding = LineWidth / 2;
var hPadding = LineWidth / 2;
var diameter = DefaultSize - LineWidth;

var checkPath = CreateCheckPath();
var checkPath = CreateCheckPath();

context.TranslateCTM(hPadding + (nfloat)(0.05 * diameter), vPadding + (nfloat)(0.1 * diameter));
context.ScaleCTM(diameter, diameter);
DrawCheckMark(checkPath);
UIColor.White.SetStroke();
checkPath.Stroke();
context.TranslateCTM(hPadding + (nfloat)(0.05 * diameter), vPadding + (nfloat)(0.1 * diameter));
context.ScaleCTM(diameter, diameter);
DrawCheckMark(checkPath);
UIColor.White.SetStroke();
checkPath.Stroke();

context.RestoreState();
context.RestoreState();
}

public override CGSize SizeThatFits(CGSize size)
Expand Down
13 changes: 6 additions & 7 deletions src/Core/src/Platform/iOS/TextFieldExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,13 @@ internal static void UpdateClearButtonColor(this UITextField textField, IEntry e

static void PaintButtonRect(CGContext? context, UIImage image, UIColor color)
{
image.Draw(CGPoint.Empty, CGBlendMode.Normal, 1.0f);
context?.SetFillColor(color.CGColor);
context?.SetBlendMode(CGBlendMode.SourceIn);
context?.SetAlpha(1.0f);

var rect = new CGRect(CGPoint.Empty.X, CGPoint.Empty.Y, image.Size.Width, image.Size.Height);
context?.FillRect(rect);
image.Draw(CGPoint.Empty, CGBlendMode.Normal, 1.0f);
context?.SetFillColor(color.CGColor);
context?.SetBlendMode(CGBlendMode.SourceIn);
context?.SetAlpha(1.0f);

var rect = new CGRect(CGPoint.Empty.X, CGPoint.Empty.Y, image.Size.Width, image.Size.Height);
context?.FillRect(rect);
}
}
}

0 comments on commit 13f106e

Please sign in to comment.