mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +00:00
Fix Bitmap#draw_text override not accepting Rect argument (#150)
This commit is contained in:
@@ -12,9 +12,14 @@ end
|
|||||||
class Bitmap
|
class Bitmap
|
||||||
alias mkxp_draw_text draw_text unless method_defined?(:mkxp_draw_text)
|
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)
|
||||||
height = text_size(text).height
|
if x.is_a?(Rect)
|
||||||
mkxp_draw_text(x, y, width, height, text, align)
|
# 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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user