Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't overlap screen name.

  • Loading branch information...
commit 0f92a41d5b1c57e63a56332e4b88bac6262c13f8 1 parent f0d96e7
@kou kou authored
Showing with 11 additions and 5 deletions.
  1. +11 −5 app.rb
View
16 app.rb
@@ -220,10 +220,11 @@ def prepare_jigoku_description(description)
end
end
-def render_witticism(context, position, witticism, paper, margin, font)
+def render_witticism(context, position, witticism, paper,
+ max_height, margin, font)
layout = make_layout(context,
witticism,
- paper.height - margin * 2,
+ max_height,
nil,
font) do |_layout|
_layout.context.base_gravity = :east
@@ -289,18 +290,23 @@ 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)
- render_witticism(context, :right, right_witticism, paper, margin, font)
+ max_witticism_height = paper.height - screen_name_max_height - margin * 2
+ render_witticism(context, :right, right_witticism, paper,
+ max_witticism_height, margin, font)
if left_witticism
- render_witticism(context, :left, left_witticism, paper, margin, font)
+ render_witticism(context, :left, left_witticism, paper,
+ max_witticism_height, margin, font)
end
screen_name = info[:screen_name]
layout = make_layout(context,
"@#{screen_name}",
paper.width - margin * 2,
- paper.height * 0.1,
+ screen_name_max_height,
font) do |_layout|
_layout.alignment = :center
end
Please sign in to comment.
Something went wrong with that request. Please try again.