This commit is contained in:
albert
2012-02-20 14:25:50 -05:00
parent 3e648f553e
commit 3eb06a43c4
3 changed files with 5 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ class PostPresenter < Presenter
end
def self.margin_left(post)
if post.is_image? && post.image_width > post.image_height && post.image_width.to_i > Danbooru.config.small_image_width
if post.is_image? && post.image_width > post.image_height && post.image_width > 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
return "-#{offset}px"