From b67fd329c68e93a5140cdc2c684909616b3bed95 Mon Sep 17 00:00:00 2001 From: 13xforever Date: Thu, 3 Jun 2021 14:03:35 +0500 Subject: [PATCH] update 3rd party deps --- .../CompatApiClient/CompatApiClient.csproj | 2 +- .../IrdLibraryClient/IrdLibraryClient.csproj | 2 +- CompatBot/Commands/Vision.cs | 21 +++++++++---------- CompatBot/CompatBot.csproj | 12 +++++------ Tests/Tests.csproj | 2 +- 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/Clients/CompatApiClient/CompatApiClient.csproj b/Clients/CompatApiClient/CompatApiClient.csproj index 170f3755..798d97d3 100644 --- a/Clients/CompatApiClient/CompatApiClient.csproj +++ b/Clients/CompatApiClient/CompatApiClient.csproj @@ -17,7 +17,7 @@ - + diff --git a/Clients/IrdLibraryClient/IrdLibraryClient.csproj b/Clients/IrdLibraryClient/IrdLibraryClient.csproj index d5f05645..622806f2 100644 --- a/Clients/IrdLibraryClient/IrdLibraryClient.csproj +++ b/Clients/IrdLibraryClient/IrdLibraryClient.csproj @@ -8,7 +8,7 @@ - + diff --git a/CompatBot/Commands/Vision.cs b/CompatBot/Commands/Vision.cs index b4df0c0f..aafc79ee 100644 --- a/CompatBot/Commands/Vision.cs +++ b/CompatBot/Commands/Vision.cs @@ -225,9 +225,8 @@ namespace CompatBot.Commands { ColorBlendingMode = PixelColorBlendingMode.Multiply, }; - var shapeOptions = new ShapeOptions(); - var shapeGraphicsOptions = new ShapeGraphicsOptions(graphicsOptions, shapeOptions); - var bgSgo = new ShapeGraphicsOptions(bgGop, shapeOptions); + var shapeDrawingOptions = new DrawingOptions { GraphicsOptions = graphicsOptions}; + var bgDrawingOptions = new DrawingOptions {GraphicsOptions = bgGop,}; var drawnBoxes = new List(objects.Count); for (var i = 0; i < objects.Count; i++) { @@ -243,7 +242,7 @@ namespace CompatBot.Commands WrapTextWidth = r.W - 10, #endif }; - var textGraphicsOptions = new TextGraphicsOptions(fgGop, textOptions); + var textDrawingOptions = new DrawingOptions {GraphicsOptions = fgGop, TextOptions = textOptions}; //var brush = Brushes.Solid(Color.Black); //var pen = Pens.Solid(color, 2); var textBox = TextMeasurer.Measure(label, textRendererOptions); @@ -253,8 +252,8 @@ namespace CompatBot.Commands // object bounding box try { - img.Mutate(ipc => ipc.Draw(shapeGraphicsOptions, complementaryColor, scale, new RectangleF(r.X, r.Y, r.W, r.H))); - img.Mutate(ipc => ipc.Draw(shapeGraphicsOptions, color, scale, new RectangleF(r.X + scale, r.Y + scale, r.W - 2 * scale, r.H - 2 * scale))); + img.Mutate(ipc => ipc.Draw(shapeDrawingOptions, complementaryColor, scale, new RectangleF(r.X, r.Y, r.W, r.H))); + img.Mutate(ipc => ipc.Draw(shapeDrawingOptions, color, scale, new RectangleF(r.X + scale, r.Y + scale, r.W - 2 * scale, r.H - 2 * scale))); } catch (Exception ex) { @@ -291,7 +290,7 @@ namespace CompatBot.Commands var textColor = color; try { - img.Mutate(ipc => ipc.Fill(bgSgo, textBoxColor, bgBox)); + img.Mutate(ipc => ipc.Fill(bgDrawingOptions, textBoxColor, bgBox)); img.Mutate(ipc => ipc.GaussianBlur(10 * scale, Rectangle.Round(bgBox))); } catch (Exception ex) @@ -303,7 +302,7 @@ namespace CompatBot.Commands try { var verticalOffset = RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows ? bboxBorder : -bboxBorder; - img.Mutate(ipc => ipc.DrawText(textGraphicsOptions, label, font, textColor, new(bgBox.X + bboxBorder, bgBox.Y + verticalOffset))); + img.Mutate(ipc => ipc.DrawText(textDrawingOptions, label, font, textColor, new(bgBox.X + bboxBorder, bgBox.Y + verticalOffset))); } catch (Exception ex) { @@ -359,9 +358,9 @@ namespace CompatBot.Commands internal static IEnumerable GetImageAttachments(DiscordMessage message) => message.Attachments.Where(a => - a.FileName.EndsWith(".jpg", StringComparison.InvariantCultureIgnoreCase) - || a.FileName.EndsWith(".png", StringComparison.InvariantCultureIgnoreCase) - || a.FileName.EndsWith(".jpeg", StringComparison.InvariantCultureIgnoreCase) + a.FileName.EndsWith(".jpg", StringComparison.InvariantCultureIgnoreCase) + || a.FileName.EndsWith(".png", StringComparison.InvariantCultureIgnoreCase) + || a.FileName.EndsWith(".jpeg", StringComparison.InvariantCultureIgnoreCase) //|| a.FileName.EndsWith(".webp", StringComparison.InvariantCultureIgnoreCase) ); diff --git a/CompatBot/CompatBot.csproj b/CompatBot/CompatBot.csproj index b7459767..375e647d 100644 --- a/CompatBot/CompatBot.csproj +++ b/CompatBot/CompatBot.csproj @@ -47,10 +47,10 @@ - - - - + + + + @@ -75,12 +75,12 @@ - + - + diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index e016b9f7..c566e46c 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -8,7 +8,7 @@ - + all