Skip to content

Instantly share code, notes, and snippets.

@followthemoney1
Created November 16, 2020 13:20
Show Gist options
  • Save followthemoney1/c24e710cbf43e6c878f07281ecde7388 to your computer and use it in GitHub Desktop.
Save followthemoney1/c24e710cbf43e6c878f07281ecde7388 to your computer and use it in GitHub Desktop.
medium
bool calcOverflowClosestElement(
{@required List<SuggestionItem> line,
@required SuggestionItem current,
bool check = false}) {
for (SuggestionItem element in line) {
if (current.rect.intersect(element.rect).height > 0 &&
current.rect.intersect(element.rect).width > 0) {
if (current.rect.intersect(element.rect).height > 0) {
if (!check) {
current.y += element.rect.intersect(current.rect).height;
}
}
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment