getRightArea method
Rect?
getRightArea(
)
override
Implementation
@override
Rect? getRightArea() {
Offset o = Offset(_offset?.dx ?? 0, _offset?.dy ?? 0);
if (getRenderObject() is RenderBox) {
Offset po = (getRenderObject() as RenderBox).localToGlobal(
Offset.zero,
ancestor: getMindMap()?.getRenderObject(),
);
o = Offset(o.dx + po.dx + (_size?.width ?? 0), o.dy + po.dy);
}
Rect rect = Rect.fromLTRB(
o.dx,
o.dy - getVSpace(),
o.dx + getHSpace() * 2,
o.dy + (_size?.height ?? 0) + getVSpace(),
);
if (getRightItems().isNotEmpty) {
double r = rect.right;
double t = rect.top;
double b = rect.bottom;
for (IMindMapNode n in getRightItems()) {
Offset o = n.getOffset() ?? Offset.zero;
if (n.getRenderObject() is RenderBox) {
Offset po = (n.getRenderObject() as RenderBox).localToGlobal(
Offset.zero,
ancestor: getMindMap()?.getRenderObject(),
);
if (o.dx + po.dx + (n.getSize()?.width ?? 0) > r) {
r = o.dx + po.dx + (n.getSize()?.width ?? 0);
}
if (o.dy + po.dy - getVSpace() < t) {
t = o.dy + po.dy - getVSpace();
}
if (o.dy + po.dy + (n.getSize()?.height ?? 0) + getVSpace() > b) {
b = o.dy + po.dy + (n.getSize()?.height ?? 0) + getVSpace();
}
}
}
rect = Rect.fromLTRB(rect.left, t, r, b);
}
return rect;
}