Skip to content

Commit

Permalink
fix #671
Browse files Browse the repository at this point in the history
  • Loading branch information
zyddnys committed Jul 17, 2024
1 parent 0653847 commit 099cbbc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion manga_translator/rendering/text_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,10 @@ def put_text_horizontal(font_size: int, text: str, width: int, height: int, alig
line_box = add_color(canvas_text, fg, canvas_border, bg)

# rect
x, y, width, height = cv2.boundingRect(canvas_border)
if bg is None :
x, y, w, h = cv2.boundingRect(canvas_text)
else :
x, y, w, h = cv2.boundingRect(canvas_border)
return line_box[y:y+height, x:x+width]

# def put_text(img: np.ndarray, text: str, line_count: int, x: int, y: int, w: int, h: int, fg: Tuple[int, int, int], bg: Optional[Tuple[int, int, int]]):
Expand Down

0 comments on commit 099cbbc

Please sign in to comment.