projects
/
selectricity
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated top the the new version of attachment_fu plugin to work out some
[selectricity]
/
vendor
/
plugins
/
attachment_fu
/
lib
/
geometry.rb
diff --git
a/vendor/plugins/attachment_fu/lib/geometry.rb
b/vendor/plugins/attachment_fu/lib/geometry.rb
index 2d6e38166fc8624baa3522c35b056b9f920b0821..73a7ca221ea496472441066f01f1cea71e908878 100644
(file)
--- a/
vendor/plugins/attachment_fu/lib/geometry.rb
+++ b/
vendor/plugins/attachment_fu/lib/geometry.rb
@@
-25,7
+25,7
@@
class Geometry
end
# Construct an object from a geometry string
end
# Construct an object from a geometry string
- RE = /\A(\d*)(?:x(\d+))?([-+]\d+)?([-+]\d+)?([%!<>@]?)\Z/
+ RE = /\A(\d*)(?:x(\d+)
?
)?([-+]\d+)?([-+]\d+)?([%!<>@]?)\Z/
def self.from_s(str)
raise(ArgumentError, "no geometry string specified") unless str
def self.from_s(str)
raise(ArgumentError, "no geometry string specified") unless str
@@
-76,7
+76,7
@@
class Geometry
new_height = orig_height if @flag && orig_height.send(@flag, new_height)
end
new_height = orig_height if @flag && orig_height.send(@flag, new_height)
end
- [new_width, new_height].collect! { |v|
v.round
}
+ [new_width, new_height].collect! { |v|
[v.round, 1].max
}
end
end
end
end
@@
-90,4
+90,4
@@
class Array
geometry = Geometry.from_s(geometry) if geometry.is_a?(String)
geometry.new_dimensions_for first, last
end
geometry = Geometry.from_s(geometry) if geometry.is_a?(String)
geometry.new_dimensions_for first, last
end
-end
\ No newline at end of file
+end
Benjamin Mako Hill
||
Want to submit a patch?