Browse Source

Fixed missing Alpha Composition property in TextGraphicsOptions

af/merge-core
Vicente Penades 8 years ago
parent
commit
4d53b82e4b
  1. 22
      src/ImageSharp.Drawing/Processing/TextGraphicsOptions.cs

22
src/ImageSharp.Drawing/Processing/TextGraphicsOptions.cs

@ -32,7 +32,9 @@ namespace SixLabors.ImageSharp.Processing
private float? dpiY;
private PixelColorBlendingMode blenderMode;
private PixelColorBlendingMode colorBlendingMode;
private PixelAlphaCompositionMode alphaCompositionMode;
private float wrapTextWidth;
@ -53,7 +55,8 @@ namespace SixLabors.ImageSharp.Processing
this.verticalAlignment = VerticalAlignment.Top;
this.antialiasSubpixelDepth = 16;
this.blenderMode = PixelColorBlendingMode.Normal;
this.colorBlendingMode = PixelColorBlendingMode.Normal;
this.alphaCompositionMode = PixelAlphaCompositionMode.SrcOver;
this.blendPercentage = 1;
this.antialias = enableAntialiasing;
this.dpiX = DefaultTextDpi;
@ -80,9 +83,14 @@ namespace SixLabors.ImageSharp.Processing
// some API thought post V1.
/// <summary>
/// Gets or sets a value indicating the blending percentage to apply to the drawing operation
/// Gets or sets a value indicating the color blending percentage to apply to the drawing operation
/// </summary>
public PixelColorBlendingMode ColorBlendingMode { get => this.colorBlendingMode; set => this.colorBlendingMode = value; }
/// <summary>
/// Gets or sets a value indicating the color blending percentage to apply to the drawing operation
/// </summary>
public PixelColorBlendingMode BlenderMode { get => this.blenderMode; set => this.blenderMode = value; }
public PixelAlphaCompositionMode AlphaCompositionMode { get => this.alphaCompositionMode; set => this.alphaCompositionMode = value; }
/// <summary>
/// Gets or sets a value indicating whether the text should be drawing with kerning enabled.
@ -135,7 +143,8 @@ namespace SixLabors.ImageSharp.Processing
{
AntialiasSubpixelDepth = options.AntialiasSubpixelDepth,
blendPercentage = options.BlendPercentage,
blenderMode = options.ColorBlendingMode
colorBlendingMode = options.ColorBlendingMode,
alphaCompositionMode = options.AlphaCompositionMode
};
}
@ -151,7 +160,8 @@ namespace SixLabors.ImageSharp.Processing
return new GraphicsOptions(options.Antialias)
{
AntialiasSubpixelDepth = options.AntialiasSubpixelDepth,
ColorBlendingMode = options.BlenderMode,
ColorBlendingMode = options.ColorBlendingMode,
AlphaCompositionMode = options.AlphaCompositionMode,
BlendPercentage = options.BlendPercentage
};
}

Loading…
Cancel
Save