バグ #1242 » 1242-score-memoize.patch
core/mui/cairo_markup_generator.rb | ||
---|---|---|
27 | 27 |
=end |
28 | 28 | |
29 | 29 |
module Gdk::MarkupGenerator |
30 |
# :nodoc: |
|
31 |
memoize def score |
|
32 |
Plugin[:gtk].score_of(message) |
|
33 |
end |
|
34 | ||
30 | 35 |
# 表示する際に本文に適用すべき装飾オブジェクトを作成する |
31 | 36 |
# ==== Return |
32 | 37 |
# Pango::AttrList 本文に適用する装飾 |
33 | 38 |
def description_attr_list(attr_list=Pango::AttrList.new, emoji_height: 24) |
34 |
Plugin[:gtk].score_of(message).inject(0){|start_index, note|
|
|
39 |
score.inject(0){|start_index, note|
|
|
35 | 40 |
end_index = start_index + note.description.bytesize |
36 | 41 |
if note.respond_to?(:inline_photo) |
37 | 42 |
end_index += -note.description.bytesize + 1 |
core/mui/cairo_miracle_painter.rb | ||
---|---|---|
44 | 44 |
message end |
45 | 45 |
deprecate :to_message, :none, 2017, 5 |
46 | 46 | |
47 |
# :nodoc: |
|
48 |
memoize def score |
|
49 |
Plugin[:gtk].score_of(message) |
|
50 |
end |
|
51 | ||
52 | 47 |
# @@miracle_painters = Hash.new |
53 | 48 | |
54 | 49 |
# _message_ を内部に持っているGdk::MiraclePainterの集合をSetで返す。 |