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

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

    /**
      @property attributeBindings
      @type {Array}
      @default ['style']
      @private
    */
    attributeBindings: ['style', 'viewBox'],

    /**
      This property sets the `points` attribute of the polygon element.
      @property points
      @type {String}
      @readonly
      @private
    */
    points: '',

    /**
      Rotate the shape.

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

    /**
      This is a computed property.  It sets the `transform` attribute  of the
      polygon element.

      @property transform
      @type {String}
      @readonly
      @private
    */
    transform: Ember.computed( 'rotate', 'size', function() {
        var rotate = this.get('rotate'),
            size = this.get('size'),
            center;

        if (!rotate || isNaN(rotate)) {
            rotate = 0;
        }

        Ember.assert('`size` must be a number greater than zero', !isNaN(size) && size > 0);

        center = size / 2;
        return 'rotate(' + rotate + ', ' + center + ', ' + center + ')';
    }),

    /**
      @property viewBox
      @type {String}
      @readonly
      @private
    */
    viewBox: Ember.computed('size', 'strokeWidth', function() {
        var size = this.get('size'),
            strokeWidth = this.get('strokeWidth');

        Ember.assert('`size` must be a number greater than zero', !isNaN(size) && size > 0);

        if (isNaN(strokeWidth))
        {
            strokeWidth = 0;
        }

        var offset = strokeWidth / 5,
            x = (strokeWidth / 2),
            y = strokeWidth - offset,
            w = parseFloat(size) + parseFloat((strokeWidth*2) - (offset * 2)),
            h = parseFloat(size) + parseFloat((strokeWidth*2) - (offset * 2));

        return '-' + x + ' -' + y + ' ' + w + ' ' + h;
    })
});<commit_msg>update polygon mixin<commit_after>/**
  @module ember-svg-shapes
*/
import Ember from 'ember';

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

    /**
      This property sets the `points` attribute of the polygon element.
      @property points
      @type {String}
      @readonly
      @private
    */
    points: '',

    /**
      Rotate the shape.

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

    /**
      This is a computed property.  It sets the `transform` attribute  of the
      polygon element.

      @property transform
      @type {String}
      @readonly
      @private
    */
    transform: Ember.computed( 'rotate', 'size', function() {
        var rotate = this.get('rotate'),
            size = this.get('size'),
            center;

        if (!rotate || isNaN(rotate)) {
            rotate = 0;
        }

        Ember.assert('`size` must be a number greater than zero', !isNaN(size) && size > 0);

        center = size / 2;
        return 'rotate(' + rotate + ', ' + center + ', ' + center + ')';
    })
});
{'fraction_non_alphanumeric': 0.1423125794155019, 'fraction_numerical': 0.005717916137229987, 'mean_word_length': 1.852355072463768, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4975023', 'n_tokens_mistral': 982, 'n_tokens_neox': 925, 'n_words': 261}