Remove superfluous area check
If area.contains(geometry.topLeft()) is false this does nothing anyway and it would always be true if either of these inside conditions is true.
If area.contains(geometry.topLeft()) is false this does nothing anyway and it would always be true if either of these inside conditions is true.