mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Fix Bitmap#draw_text override not accepting Rect argument (#150)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user