Skip to content

Commit

Permalink
fix: always return a new bbox when changing origin
Browse files Browse the repository at this point in the history
Signed-off-by: Michele Dolfi <[email protected]>
  • Loading branch information
dolfim-ibm committed Jan 17, 2025
1 parent c940aa5 commit 96e59cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docling_core/types/doc/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def to_bottom_left_origin(self, page_height: float) -> "BoundingBox":
"""
if self.coord_origin == CoordOrigin.BOTTOMLEFT:
return self
return self.model_copy()
elif self.coord_origin == CoordOrigin.TOPLEFT:
return BoundingBox(
l=self.l,
Expand All @@ -167,7 +167,7 @@ def to_top_left_origin(self, page_height: float) -> "BoundingBox":
"""
if self.coord_origin == CoordOrigin.TOPLEFT:
return self
return self.model_copy()
elif self.coord_origin == CoordOrigin.BOTTOMLEFT:
return BoundingBox(
l=self.l,
Expand Down

0 comments on commit 96e59cc

Please sign in to comment.