|
@@ -1389,7 +1389,7 @@
|
|
|
this._zOrder = 0;
|
|
|
this._zMax = 0;
|
|
|
this._firstZDirtyIndex = Prim2DBase._bigInt;
|
|
|
- this._setFlags(SmartPropertyPrim.flagIsPickable | SmartPropertyPrim.flagBoundingInfoDirty | SmartPropertyPrim.flagActualOpacityDirty);
|
|
|
+ this._setFlags(SmartPropertyPrim.flagIsPickable | SmartPropertyPrim.flagBoundingInfoDirty | SmartPropertyPrim.flagActualOpacityDirty | SmartPropertyPrim.flagIsContainer);
|
|
|
|
|
|
if (settings.opacity != null) {
|
|
|
this._opacity = settings.opacity;
|
|
@@ -2196,6 +2196,20 @@
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Define if the Primitive acts as a container or not
|
|
|
+ * A container will encapsulate its children for interaction event.
|
|
|
+ * If it's not a container events will be process down to children if the primitive is not pickable.
|
|
|
+ * Default value is true
|
|
|
+ */
|
|
|
+ public get isContainer(): boolean {
|
|
|
+ return this._isFlagSet(SmartPropertyPrim.flagIsContainer);
|
|
|
+ }
|
|
|
+
|
|
|
+ public set isContainer(value: boolean) {
|
|
|
+ this._changeFlags(SmartPropertyPrim.flagIsContainer, value);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Return the depth level of the Primitive into the Canvas' Graph. A Canvas will be 0, its direct children 1, and so on.
|
|
|
*/
|
|
|
public get hierarchyDepth(): number {
|
|
@@ -2414,7 +2428,7 @@
|
|
|
if (!levelIntersectRes || !intersectInfo.findFirstOnly) {
|
|
|
for (let curChild of this._children) {
|
|
|
// Don't test primitive not pick able or if it's hidden and we don't test hidden ones
|
|
|
- if (!curChild.isPickable || (!intersectInfo.intersectHidden && !curChild.isVisible)) {
|
|
|
+ if ((!curChild.isPickable && curChild.isContainer) || (!intersectInfo.intersectHidden && !curChild.isVisible)) {
|
|
|
continue;
|
|
|
}
|
|
|
|