Skip to content
Browse files

render screen name before witticism.

  • Loading branch information...
1 parent 7de8188 commit 1203531614009789aa396e37b783bc379208dcf6 @kou kou committed Dec 22, 2010
Showing with 14 additions and 15 deletions.
  1. +14 −15 app.rb
View
29 app.rb
@@ -229,7 +229,7 @@ def render_witticism(context, position, witticism, paper,
font) do |_layout|
_layout.context.base_gravity = :east
description = _layout.font_description
- description.size = 16 * Pango::SCALE
+ description.size = 14 * Pango::SCALE
_layout.font_description = description
end
@@ -290,21 +290,8 @@ def render_to_surface_jigoku(surface, scale, paper, info, font)
render_frame(context, paper, margin * 0.5)
- screen_name_max_height = paper.height * 0.1
-
- description = prepare_jigoku_description(info[:description] || "")
- right_witticism, left_witticism, garbages = description.split(/\n\n/, 3)
- max_witticism_height = paper.height - screen_name_max_height - margin * 2
- if right_witticism
- render_witticism(context, :right, right_witticism, paper,
- max_witticism_height, margin, font)
- end
- if left_witticism
- render_witticism(context, :left, left_witticism, paper,
- max_witticism_height, margin, font)
- end
-
screen_name = info[:screen_name]
+ screen_name_max_height = paper.height * 0.1
layout = make_layout(context,
"@#{screen_name}",
paper.width - margin * 2,
@@ -327,6 +314,18 @@ def render_to_surface_jigoku(surface, scale, paper, info, font)
context.show_pango_layout(layout)
end
+ description = prepare_jigoku_description(info[:description] || "")
+ right_witticism, left_witticism, garbages = description.split(/\n\n/, 3)
+ max_witticism_height = paper.height - margin * 2
+ if right_witticism
+ render_witticism(context, :right, right_witticism, paper,
+ max_witticism_height, margin, font)
+ end
+ if left_witticism
+ render_witticism(context, :left, left_witticism, paper,
+ max_witticism_height, margin, font)
+ end
+
context.show_page
end

0 comments on commit 1203531

Please sign in to comment.
Something went wrong with that request. Please try again.