getLeftArea method
Rect?
getLeftArea(
)
override
Implementation
@override
Rect? getLeftArea() {
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, o.dy + po.dy);
}
Rect rect = Rect.fromLTRB(
o.dx - getHSpace() * 2,
o.dy - getVSpace(),
o.dx,
o.dy + (_size?.height ?? 0) + getVSpace(),
);
if (getLeftItems().isNotEmpty) {
double l = rect.left;
double t = rect.top;
double b = rect.bottom;
for (IMindMapNode n in getLeftItems()) {
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 < l) {
l = o.dx + po.dx;
}
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(l, t, rect.right, b);
}
return rect;
}