lib/vedeu/geometry/generic_coordinate.rb in vedeu-0.6.15 vs lib/vedeu/geometry/generic_coordinate.rb in vedeu-0.6.16

- old
+ new

@@ -26,17 +26,13 @@ # # d_dn = 4 # represents width or height # dn # => 6 # # @return [Fixnum] def dn - if d_dn <= 0 - 0 + return 0 if d_dn <= 0 - else - d + d_dn - - end + d + d_dn end alias_method :xn, :dn alias_method :yn, :dn # Returns the coordinate for a given index. @@ -135,16 +131,12 @@ # # d_dn = 3 # dn_index # => 2 # # @return [Fixnum] def dn_index - if d_dn < 1 - 0 + return 0 if d_dn < 1 - else - d_dn - 1 - - end + d_dn - 1 end # Returns an array with all coordinates from d to dn. # # @example