private void CenterSVGPath() { // Move icon to center of "dot" SKRect iconBounds = new SKRect(); SVG.GetBounds(out iconBounds); SKMatrix translate = SKMatrix.MakeTranslation(Center.X - iconBounds.Width / 2, Center.Y - iconBounds.Height / 2); SVG.Transform(translate); }
private void ScaleSVGPath() { // Scale down to fit inside of "dot" SKRect iconBounds = new SKRect(); SVG.GetBounds(out iconBounds); float iconMax = Math.Max(iconBounds.Width, iconBounds.Height); float iconWidth = (float)Math.Sqrt(2 * Math.Pow(Radius, 2)); var iconScale = iconWidth / iconMax; SKMatrix scaleMatrix = SKMatrix.MakeScale(iconScale, iconScale); SVG.Transform(scaleMatrix); }