Skip to content

Commit 1fa9e9e

Browse files
committed
fix: skip widgets with empty or infinite rects in remove_rotation
remove_rotation() calls widget.update() on every widget, but widgets with empty or infinite rects (like invisible signature fields) cause ValueError('bad rect') during validation. Skip these widgets and also guard widget.update() with a try/except for any remaining edge cases. Fixes #4950
1 parent 564f14d commit 1fa9e9e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11913,8 +11913,13 @@ def remove_rotation(self):
1191311913
pass
1191411914
for widget in self.widgets(): # modify field rectangles
1191511915
r = widget.rect * rot
11916+
if r.is_empty or r.is_infinite:
11917+
continue
1191611918
widget.rect = r
11917-
widget.update()
11919+
try:
11920+
widget.update()
11921+
except ValueError:
11922+
pass
1191811923
return rot # the inverse of the generated derotation matrix
1191911924

1192011925
def cluster_drawings(

0 commit comments

Comments
 (0)