fixes #329
This commit is contained in:
@@ -20,7 +20,7 @@ class PostPresenter < Presenter
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.margin_top(post)
|
def self.margin_top(post)
|
||||||
if post.is_image? && post.image_height > post.image_width && post.image_height < 2 * post.image_width && post.image_height
|
if post.is_image? && post.image_height > post.image_width && post.image_height > Danbooru.config.small_image_width && post.image_height < 1.5 * post.image_width
|
||||||
ratio = Danbooru.config.small_image_width.to_f / post.image_width.to_f
|
ratio = Danbooru.config.small_image_width.to_f / post.image_width.to_f
|
||||||
offset = ((ratio * post.image_height) - Danbooru.config.small_image_width).to_i / 2
|
offset = ((ratio * post.image_height) - Danbooru.config.small_image_width).to_i / 2
|
||||||
return "-#{offset}px"
|
return "-#{offset}px"
|
||||||
|
|||||||
Reference in New Issue
Block a user