mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 17:58:26 -04:00
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:
@@ -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
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user