Fix Bitmap#draw_text override not accepting Rect argument (#150)

This commit is contained in:
Joni Savolainen
2022-01-09 23:22:40 +02:00
committed by GitHub
parent 507014e655
commit 767a47d90f

View File

@@ -12,10 +12,15 @@ end
class Bitmap
alias mkxp_draw_text draw_text unless method_defined?(:mkxp_draw_text)
def draw_text(x, y, width, height, text, align = 0)
def draw_text(x, y, width, height = nil, text = "", align = 0)
if x.is_a?(Rect)
# rect, string & alignment
mkxp_draw_text(x, y, width)
else
height = text_size(text).height
mkxp_draw_text(x, y, width, height, text, align)
end
end
end
module Graphics