Fix QPointF IndexError: list index out of range #11393
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
当QPointF 获取异常时,self.center 赋予默认值
PR 类型 PR types
Bug fixes
PR 变化内容类型 PR changes
Others
描述 Description
操作矩形绘制时,有机会导致异常退出。增加异常处理机制。
异常信息:
”PPOCRLabel\libs\shape.py", line 95, in close
self.center = QPointF((self.points[0].x() + self.points[2].x()) / 2,
IndexError: list index out of range
提PR之前的检查 Check-list
This PR is pushed to the dygraph branch or cherry-picked from the dygraph branch. Otherwise, please push your changes to the dygraph branch.