diff --git a/core/mui/cairo_markup_generator.rb b/core/mui/cairo_markup_generator.rb index c8e62be..937647b 100644 --- a/core/mui/cairo_markup_generator.rb +++ b/core/mui/cairo_markup_generator.rb @@ -27,11 +27,16 @@ module Pango =end module Gdk::MarkupGenerator + # :nodoc: + memoize def score + Plugin[:gtk].score_of(message) + end + # 表示する際に本文に適用すべき装飾オブジェクトを作成する # ==== Return # Pango::AttrList 本文に適用する装飾 def description_attr_list(attr_list=Pango::AttrList.new, emoji_height: 24) - Plugin[:gtk].score_of(message).inject(0){|start_index, note| + score.inject(0){|start_index, note| end_index = start_index + note.description.bytesize if note.respond_to?(:inline_photo) end_index += -note.description.bytesize + 1 diff --git a/core/mui/cairo_miracle_painter.rb b/core/mui/cairo_miracle_painter.rb index 9e7049f..b6c130c 100644 --- a/core/mui/cairo_miracle_painter.rb +++ b/core/mui/cairo_miracle_painter.rb @@ -44,11 +44,6 @@ class Gdk::MiraclePainter < Gtk::Object message end deprecate :to_message, :none, 2017, 5 - # :nodoc: - memoize def score - Plugin[:gtk].score_of(message) - end - # @@miracle_painters = Hash.new # _message_ を内部に持っているGdk::MiraclePainterの集合をSetで返す。