diff --git a/app/presenters/post_presenter.rb b/app/presenters/post_presenter.rb index 020023e9d..c89487dd1 100644 --- a/app/presenters/post_presenter.rb +++ b/app/presenters/post_presenter.rb @@ -14,12 +14,15 @@ class PostPresenter < Presenter html = %{
} html << %{} - if post.image_width.to_i > post.image_height.to_i * 1.3 && post.image_width.to_i > Danbooru.config.small_image_width && !post.is_flash? - klass = "wide" + if post.is_image? && post.image_width > post.image_height && post.image_width.to_i > Danbooru.config.small_image_width + ratio = Danbooru.config.small_image_width.to_f / post.image_height.to_f + offset = ((ratio * post.image_width) - Danbooru.config.small_image_width).to_i / 2 + margin = "-#{offset}px" else - klass = "tall" + margin = 0 end - html << %{#{h(post.tag_string)}} + + html << %{#{h(post.tag_string)}} html << %{} html << %{
} html.html_safe