@@ -20,6 +20,7 @@ class GrandchildRectangle extends Component {
20
20
scaleY,
21
21
childId,
22
22
componentId,
23
+ childType,
23
24
childComponentName,
24
25
childComponentId,
25
26
width,
@@ -46,41 +47,46 @@ class GrandchildRectangle extends Component {
46
47
y = { 0 }
47
48
childId = { childId }
48
49
componentId = { componentId }
50
+ childType = { childType }
49
51
scaleX = { 1 }
50
52
scaleY = { 1 }
51
53
width = { width }
52
54
height = { height }
53
- stroke = { this . getComponentColor ( childComponentId ) }
55
+ stroke = { childType === 'COMP' ? this . getComponentColor ( childComponentId ) : '#000000' }
54
56
// fill={color}
55
57
// opacity={0.8}
56
58
strokeWidth = { 4 }
57
59
strokeScaleEnabled = { false }
58
60
draggable = { false }
59
61
/>
60
- { components
61
- . find ( comp => comp . title === childComponentName )
62
- . childrenArray . filter ( child => child . childId !== '-1' )
63
- . map ( ( grandchild , i ) => (
64
- < GrandchildRectangle
65
- key = { i }
66
- components = { components }
67
- componentId = { componentId }
68
- childComponentName = { grandchild . componentName }
69
- childComponentId = { grandchild . childComponentId }
70
- focusChild = { focusChild }
71
- childId = { childId }
72
- width = { grandchild . position . width * ( width / this . getPseudoChild ( ) . position . width ) }
73
- height = { grandchild . position . height * ( height / this . getPseudoChild ( ) . position . height ) }
74
- x = {
75
- ( grandchild . position . x - this . getPseudoChild ( ) . position . x )
76
- * ( width / this . getPseudoChild ( ) . position . width )
77
- }
78
- y = {
79
- ( grandchild . position . y - this . getPseudoChild ( ) . position . y )
80
- * ( height / this . getPseudoChild ( ) . position . height )
81
- }
82
- />
83
- ) ) }
62
+ { childType === 'COMP'
63
+ && components
64
+ . find ( comp => comp . title === childComponentName )
65
+ . childrenArray . filter ( child => child . childId !== '-1' )
66
+ . map ( ( grandchild , i ) => (
67
+ < GrandchildRectangle
68
+ key = { i }
69
+ components = { components }
70
+ componentId = { componentId }
71
+ childType = { grandchild . childType }
72
+ childComponentName = { grandchild . componentName }
73
+ childComponentId = { grandchild . childComponentId }
74
+ focusChild = { focusChild }
75
+ childId = { childId }
76
+ width = { grandchild . position . width * ( width / this . getPseudoChild ( ) . position . width ) }
77
+ height = {
78
+ grandchild . position . height * ( height / this . getPseudoChild ( ) . position . height )
79
+ }
80
+ x = {
81
+ ( grandchild . position . x - this . getPseudoChild ( ) . position . x )
82
+ * ( width / this . getPseudoChild ( ) . position . width )
83
+ }
84
+ y = {
85
+ ( grandchild . position . y - this . getPseudoChild ( ) . position . y )
86
+ * ( height / this . getPseudoChild ( ) . position . height )
87
+ }
88
+ />
89
+ ) ) }
84
90
</ Group >
85
91
) ;
86
92
}
0 commit comments