File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/Blazor.Extensions.Canvas/Canvas2D Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ public class Canvas2DContext : RenderingContext
54
54
private const string RESTORE_METHOD = "restore" ;
55
55
private const string DRAW_IMAGE_METHOD = "drawImage" ;
56
56
private const string CREATE_PATTERN_METHOD = "createPattern" ;
57
+ private const string GLOBAL_COMPOSITE_OPERATION_PROPERTY = "globalCompositeOperation" ;
57
58
58
59
private readonly string [ ] _repeatNames = new [ ]
59
60
{
@@ -96,6 +97,8 @@ public class Canvas2DContext : RenderingContext
96
97
97
98
public float GlobalAlpha { get ; private set ; } = 1.0f ;
98
99
100
+ public string GlobalCompositeOperation { get ; private set ; } = "source-over" ;
101
+
99
102
#endregion Properties
100
103
101
104
public Canvas2DContext ( BECanvasComponent reference ) : base ( reference , CONTEXT_NAME )
@@ -200,6 +203,12 @@ public async Task SetGlobalAlphaAsync(float value)
200
203
await this . BatchCallAsync ( GLOBAL_ALPHA_PROPERTY , isMethodCall : false , value ) ;
201
204
}
202
205
206
+ public async Task SetGlobalCompositeOperationAsync ( string value )
207
+ {
208
+ this . GlobalCompositeOperation = value ;
209
+ await this . BatchCallAsync ( GLOBAL_COMPOSITE_OPERATION_PROPERTY , isMethodCall : false , value ) ;
210
+ }
211
+
203
212
#endregion Property Setters
204
213
205
214
#region Methods
You can’t perform that action at this time.
0 commit comments