getOffsetToAncestor method
Offset
getOffsetToAncestor(
- Offset point,
- RenderBoxModel ancestor, {
- bool excludeScrollOffset = false,
Implementation
Offset getOffsetToAncestor(Offset point, RenderBoxModel ancestor, {bool excludeScrollOffset = false}) {
double ancestorBorderTop = ancestor.renderStyle.borderTopWidth?.computedValue ?? 0;
double ancestorBorderLeft = ancestor.renderStyle.borderLeftWidth?.computedValue ?? 0;
Offset ancestorBorderWidth = Offset(ancestorBorderLeft, ancestorBorderTop);
return getLayoutTransformTo(this, ancestor, excludeScrollOffset: excludeScrollOffset) + point - ancestorBorderWidth;
}