Conditions | 5 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | def set_points(self, points): |
||
2 | """ |
||
3 | Set coordinate polygon by given string. |
||
4 | Moreover, invalidate the parent's AlternativeImages |
||
5 | (because they will have been cropped with a bbox |
||
6 | of the previous polygon). |
||
7 | """ |
||
8 | if hasattr(self, 'parent_object_'): |
||
9 | parent = self.parent_object_ |
||
10 | if hasattr(parent, 'invalidate_AlternativeImage'): |
||
11 | # RegionType, TextLineType, WordType, GlyphType: |
||
12 | parent.invalidate_AlternativeImage() |
||
13 | elif hasattr(parent, 'parent_object_') and hasattr(parent.parent_object_, 'invalidate_AlternativeImage'): |
||
14 | # BorderType: |
||
15 | parent.parent_object_.invalidate_AlternativeImage(feature_selector='cropped') |
||
16 | self.points = points |
||
17 |