You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] Implicit conversions between ValueTuples and SKPoint #2862
I would like to be able to specify points in an easier way.
Describe the solution you would like
Therefore, I suggest adding an implicit conversion between a ValueTuple and a SKPoint as well as a deconstructor:
// In struct SKPointpublicstaticimplicitoperator SKPoint((floatx,floaty)tuple)=>newSKPoint(tuple.x,tuple.y);publicvoidDeconstruct(outfloatx,outfloaty)=>(x=X,y=Y);
This would allow us to define a point as SKPoint point = (x, y); instead of SKPoint point = new SKPoint(x, y);.
The inverse would also be possible: var (x, y) = point;.
Describe alternatives you have considered
It is currently (C#12) not possible to declare an implicit operator as extension method.
Activity
ai-triage: backfill #3279, #1902, #3015, #2862, #3005, #3638, #2832, #…