fixes #1648
This commit is contained in:
@@ -113,7 +113,7 @@ class Note < ActiveRecord::Base
|
|||||||
|
|
||||||
def note_within_image
|
def note_within_image
|
||||||
return false unless post.present?
|
return false unless post.present?
|
||||||
if x < 0 || y < 0 || (x > post.image_width) || (y > post.image_height) || width < 0 || height < 0 || (x + width > post.image_width) || (y + height > post.image_height)
|
if x <= 0 || y <= 0 || (x >= post.image_width) || (y >= post.image_height) || width <= 0 || height <= 0 || (x + width >= post.image_width) || (y + height >= post.image_height)
|
||||||
self.errors.add(:note, "must be inside the image")
|
self.errors.add(:note, "must be inside the image")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user