Dart_Handle Paragraph::getPositionForOffset(double dx, double dy) { LayoutPoint point(dx, dy); PositionWithAffinity position = m_renderView->positionForPoint(point); Dart_Handle result = Dart_NewList(2); Dart_ListSetAt(result, 0, ToDart(absoluteOffsetForPosition(position))); Dart_ListSetAt(result, 1, ToDart(static_cast<int>(position.affinity()))); return result; }
VisiblePosition::VisiblePosition(const PositionWithAffinity& positionWithAffinity) { init(positionWithAffinity.position(), positionWithAffinity.affinity()); }