Skip to content

Commit

Permalink
Fixed email overflow bug in tickets pdf
Browse files Browse the repository at this point in the history
closes openSUSE#1691

minor changes
  • Loading branch information
ViditChitkara authored and differentreality committed Oct 2, 2017
1 parent 99e5af3 commit d6c7e8d
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions app/pdfs/ticket_pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,23 @@ def draw_first_square
move_up @mid_vertical
draw_text 'TICKET HOLDER', at: [@x, cursor - 30], size: 17
dash(2, space: 0)
stroke_rectangle [@x, cursor - 50], 230, 150
move_down 80
draw_text 'NAME', at: [@x + 10, cursor], size: 13
fill_color '808080'
draw_text @user.name.to_s, at: [@x + 10, cursor - 25], size: 20
fill_color '000000'
draw_text 'EMAIL', at: [@x + 10, cursor - 50], size: 13
fill_color '808080'
draw_text @user.email.to_s, at: [@x + 10, cursor - 75], size: 20
fill_color '000000'
move_up 20
bounding_box [@x, cursor - 50], width: 230, height: 150 do
pad(15) do
text_box 'NAME', at: [@x + 10, cursor], size: 13
fill_color '808080'
text_box @user.name.to_s, at: [@x + 10, cursor - 20], size: 18
fill_color '000000'
text_box 'EMAIL', at: [@x + 10, cursor - 60], size: 13
fill_color '808080'
text_box @user.email.to_s, at: [@x + 10, cursor - 80], size: 18, overflow: :shrink_to_fit
fill_color '000000'
end
stroke_bounds
end
end

def draw_second_square
move_up 150
if @conference.picture?
if 7 * @conference.picture.image[:width] > 12 * @conference.picture.image[:height]
image "#{Rails.root}/public#{@conference.picture_url}", at: [@mid_horizontal + 30, cursor], width: 120
Expand Down

0 comments on commit d6c7e8d

Please sign in to comment.