lib/teacup/stylesheet_extensions/constraints.rb in teacup-1.0.3 vs lib/teacup/stylesheet_extensions/constraints.rb in teacup-1.0.4

- old
+ new

@@ -41,12 +41,12 @@ Teacup::Constraint.new(:self, :height).equals(height) end def constrain_size(width, height) [ - Teacup::Constraint.new(:self, :right).equals(:self, :left).plus(width), - Teacup::Constraint.new(:self, :bottom).equals(:self, :top).plus(height), + Teacup::Constraint.new(:self, :width).equals(width), + Teacup::Constraint.new(:self, :height).equals(height), ] end ##| def constrain_below(relative_to, margin=0) @@ -54,10 +54,10 @@ Teacup::Constraint.new(:self, :top).equals(relative_to, :bottom).plus(margin) end def constrain_above(relative_to, margin=0) margin = 8 if margin == :auto - Teacup::Constraint.new(:self, :bottom).equals(relative_to, :top).plus(margin) + Teacup::Constraint.new(:self, :bottom).equals(relative_to, :top).minus(margin) end def constrain_to_right(relative_to, margin=0) margin = 20 if margin == :auto Teacup::Constraint.new(:self, :left).equals(relative_to, :right).plus(margin)