lib/cyberarm_engine/text.rb in cyberarm_engine-0.23.0 vs lib/cyberarm_engine/text.rb in cyberarm_engine-0.24.0
- old
+ new
@@ -79,10 +79,11 @@
def swap_font(size, font_name = @font)
if @size != size || @font != font_name
@size = size
@font = font_name
+ invalidate_cache!
@textobject = check_cache(size, font_name)
end
end
def text=(string)
@@ -147,9 +148,11 @@
textobject.text_width(text) + spacing
end
end
def markup_width(text = @text)
+ text = text.to_s
+
spacing = 0
spacing += @border_size if @border
spacing += @shadow_size if @shadow
if text == @text && @static && @gosu_cached_text_image