do not use index when searching in large areas

This concerns viewboxes as well as radius search.
This commit is contained in:
Sarah Hoffmann
2023-08-12 16:12:44 +02:00
parent fa3ac22a8f
commit cab2a74740
4 changed files with 22 additions and 4 deletions

View File

@@ -253,6 +253,8 @@ class _TokenSequence:
priors = sum(1 for t in self.seq[hnrpos+1:] if t.ttype == qmod.TokenType.PARTIAL)
if not self._adapt_penalty_from_priors(priors, 1):
return False
if any(t.ttype == qmod.TokenType.CATEGORY for t in self.seq):
self.penalty += 1.0
return True