Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zyddnys committed Nov 30, 2024
1 parent e406228 commit 1fc572c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions manga_translator/rendering/text_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,12 +733,8 @@ def put_text_horizontal(font_size: int, text: str, width: int, height: int, alig
canvas_border = np.clip(canvas_border, 0, 255)
line_box = add_color(canvas_text, fg, canvas_border, bg)

# rect
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]
x, y, w, h = cv2.boundingRect(canvas_border)
return line_box[y:y+h, x:x+w]

# 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]]):
# pass
Expand Down

0 comments on commit 1fc572c

Please sign in to comment.