Removed cmd source generator. Commands are no longer partial methods. Compilations should be slightly faster now. Updated packages and adapted drawing code to the new apis. There may be some bugs.

This commit is contained in:
Kwoth
2022-07-18 04:33:50 +02:00
parent 3db194c186
commit 99c60459f8
98 changed files with 747 additions and 788 deletions

View File

@@ -12,32 +12,6 @@ namespace NadekoBot.Extensions;
public static class ImagesharpExtensions
{
/// <summary>
/// Adds fallback fonts to <see cref="TextOptions" />
/// </summary>
/// <param name="opts"><see cref="TextOptions" /> to which fallback fonts will be added to</param>
/// <param name="fallback">List of fallback Font Families to add</param>
/// <returns>The same <see cref="TextOptions" /> to allow chaining</returns>
public static TextOptions WithFallbackFonts(this TextOptions opts, List<FontFamily> fallback)
{
foreach (var ff in fallback)
opts.FallbackFonts.Add(ff);
return opts;
}
/// <summary>
/// Adds fallback fonts to <see cref="TextGraphicsOptions" />
/// </summary>
/// <param name="opts"><see cref="TextGraphicsOptions" /> to which fallback fonts will be added to</param>
/// <param name="fallback">List of fallback Font Families to add</param>
/// <returns>The same <see cref="TextGraphicsOptions" /> to allow chaining</returns>
public static TextGraphicsOptions WithFallbackFonts(this TextGraphicsOptions opts, List<FontFamily> fallback)
{
opts.TextOptions.WithFallbackFonts(fallback);
return opts;
}
// https://github.com/SixLabors/Samples/blob/master/ImageSharp/AvatarWithRoundedCorner/Program.cs
public static IImageProcessingContext ApplyRoundedCorners(this IImageProcessingContext ctx, float cornerRadius)
{
@@ -93,7 +67,7 @@ public static class ImagesharpExtensions
new()
{
ColorType = PngColorType.RgbWithAlpha,
CompressionLevel = PngCompressionLevel.BestCompression
CompressionLevel = PngCompressionLevel.DefaultCompression
});
}