/**
  @module ember-svg-shapes
*/
import Ember from 'ember';

/**
  @class RectMixin
  @namespace SvgShapes.Mixins
*/
export default Ember.Mixin.create({

    /**
      This value sets the `rx` attribute of the `rect` element.

      @property radiusX
      @type {Number}
      @default 0
    */
    radiusX: 0,

    /**
      This value sets the `ry` attribute of the `rect` element.

      @property radiusY
      @type {Number}
      @default 0
    */
    radiusY: 0,

    /**
      This is a computed property.  It sets the height of the rectangle shape based
      on the height of the svg image element and the stroke width.

      @property _height
      @type {Number}
      @readonly
      @private
    */
    _height: Ember.computed('height', 'strokeWidth', function() {
        var height = this.get('height'),
            strokeWidth = this.get('strokeWidth');
        return height - strokeWidth;
    }),

    /**
      This is a computed property.  It sets the width of the rectangle shape based
      on the width of the svg image element and the stroke width.

      @property _width
      @type {Number}
      @readonly
      @private
    */
    _width: Ember.computed('width', 'strokeWidth', function() {
        var width = this.get('width'),
            strokeWidth = this.get('strokeWidth');
        return width - strokeWidth;
    }),

    /**
      This is a computed property.  It sets the left coordinate of the rectangle
      shape based on the stroke width.

      @property left
      @type {Number}
      @readonly
      @private
    */
    left: Ember.computed('strokeWidth', function() {
        var strokeWidth = this.get('strokeWidth');
        return strokeWidth / 2;
    }),

    /**
      This is an alias of `left`.
      
      @property top
      @type {Number}
      @readonly
      @private
    */
    top: Ember.computed.alias('left')
});

@@ -745,34 +745,27 @@
 'height', 's
-trokeWidth
+ize
 ', function(
@@ -818,34 +818,27 @@
            s
-trokeWidth
+ize
  = this.get(
@@ -839,38 +839,32 @@
 s.get('s
-trokeWidth
+ize
 ');%0A
+%0A
         
 return h
@@ -859,35 +859,221 @@
     
-return height - strokeWidth
+Ember.assert('%60height%60 must be a number greater than zero', !isNaN(height) && height %3E 0);%0A        Ember.assert('%60size%60 must be a number greater than zero', !isNaN(size) && size %3E 0);%0A%0A        return height * size
 ;%0A  
@@ -1357,26 +1357,19 @@
 dth', 's
-trokeWidth
+ize
 ', funct
@@ -1428,26 +1428,19 @@
        s
-trokeWidth
+ize
  = this.
@@ -1445,38 +1445,32 @@
 s.get('s
-trokeWidth
+ize
 ');%0A
+%0A
         
 return w
@@ -1465,358 +1465,190 @@
     
-return width - strokeWidth;%0A    %7D),%0A%0A    /**%0A      This is a computed property.  It sets the left coordinate of the rectangle%0A      shape based on the stroke width.%0A%0A      @property left%0A      @type %7BNumber%7D%0A      @readonly%0A      @private%0A    */%0A    left: Ember.computed('strokeWidth', function() %7B%0A        var strokeWidth = this.get('strokeWidth'
+Ember.assert('%60width%60 must be a number greater than zero', !isNaN(width) && width %3E 0);%0A        Ember.assert('%60size%60 must be a number greater than zero', !isNaN(size) && size %3E 0
 );%0A
+%0A
     
@@ -1662,23 +1662,20 @@
 urn 
-strokeWidth / 2
+width * size
 ;%0A  
@@ -1699,42 +1699,72 @@
     
-This is an alias of %60left%60.
+@property left%0A      @type %7BNumber%7D%0A    */%0A    left: 0,%0A
 %0A    
-  
+/**
 %0A   
@@ -1809,79 +1809,21 @@
     
-  @readonly%0A      @private%0A    */%0A    top: Ember.computed.alias('left')
+*/%0A    top: 0
 %0A%7D);

update rect mixin