Skip to content

Commit 76601d9

Browse files
committed
[csharp] Port of commit 27f6c52: Improved clipping performance, added convex and inverse.
1 parent acab83e commit 76601d9

File tree

4 files changed

+488
-252
lines changed

4 files changed

+488
-252
lines changed

spine-csharp/src/Attachments/ClippingAttachment.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,34 @@
3232
namespace Spine {
3333
public class ClippingAttachment : VertexAttachment {
3434
internal SlotData endSlot;
35+
internal bool convex, inverse;
3536

3637
/// <summary>Clipping is performed between the clipping attachment's slot and the end slot. If null, clipping is done until the end of
3738
/// the skeleton's rendering.</summary>
3839
public SlotData EndSlot { get { return endSlot; } set { endSlot = value; } }
3940

41+
/// <summary>
42+
/// When true the clipping polygon is treated as convex for more efficient clipping. If the polygon deforms to concave then the
43+
/// convex hull is used.When false the clipping polygon can be concave and if so has an additional CPU cost.Inverse clipping
44+
/// always uses convex.
45+
/// </summary>
46+
public bool Convex { get { return convex; } set { convex = value; } }
47+
48+
/// <summary>
49+
/// When false, everything inside the clipping polygon is visible. When true, everything outside the clipping polygon is
50+
/// visible and clipping is convex.
51+
/// </summary>
52+
public bool Inverse { get { return inverse; } set { inverse = value; } }
53+
4054
public ClippingAttachment (string name) : base(name) {
4155
}
4256

4357
/// <summary>Copy constructor.</summary>
4458
protected ClippingAttachment (ClippingAttachment other)
4559
: base(other) {
4660
endSlot = other.endSlot;
61+
convex = other.convex;
62+
inverse = other.inverse;
4763
}
4864

4965
public override Attachment Copy () {

0 commit comments

Comments
 (0)