using System.Collections.Generic; using System.Drawing; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace UseCases { internal static class Utils { /// /// Translate a PointF /// /// Original PointF /// Horizontal offset /// Vertical offset /// Translated point public static PointF TranslatePointF(PointF input, float offX, float offY) { return new PointF(input.X + offX, input.Y + offY); } /// /// Translate a SizeF /// /// Original SizeF /// Horizontal offset /// Vertical offset /// Translated point public static SizeF TranslateSizeF(SizeF input, float offX, float offY) { var returnSize = new SizeF(input); returnSize.Width += offX; returnSize.Height += offY; return returnSize; } public static JsonSerializerSettings SerializerSettings => new JsonSerializerSettings { PreserveReferencesHandling = PreserveReferencesHandling.Objects, Converters = new List{new VersionConverter()}}; } }