<commit_before>// Copyright 2002-2013, University of Colorado Boulder

/**
 * Card shape for the 'Build a Fraction' sim.
 * Expected denominator equal to 1.
 *
 * @author <NAME> (Mlearner)
 */

define( function( require ) {
  "use strict";

  // imports
  var inherit = require( 'PHET_CORE/inherit' ),
    Node = require( 'SCENERY/nodes/Node' ),
    AbstractShape = require( 'FRACTION_COMMON/shapes/AbstractShape' ),
    Rectangle = require( 'SCENERY/nodes/Rectangle' ),
    Text = require( 'SCENERY/nodes/Text' ),
    PhetFont = require( 'SCENERY_PHET/PhetFont' ),
    FONT = new PhetFont( {size: 45, weight: 'bold'} );

  function NumericSimplifiedShape( options ) {
    var width,
      height,
      text,
      cardTop,
      numerator,
      cards = new Node(), // container for all cards
      offset = 3;

    AbstractShape.call( this, options );
    options = this.options;
    numerator = options.numerator;
    width = options.width;
    height = width * 1.43;

    // create top card with number
    cardTop = this.getCardNode( width, height );
    text = new Text( numerator, {font: FONT} );
    text.setTranslation( -text.getWidth() / 2, text.getHeight() / 4 );
    cardTop.addChild( text );

    if ( options.deck ) {
      // add all cards except top one
      for ( var i = 0; i < numerator - 1; i++ ) {
        cards.addChild( this.getCardNode( width, height ).setTranslation( offset * i, offset * i ) );
      }

      // set translations
      cardTop.setTranslation( offset * (numerator - 1), offset * (numerator - 1) );
      cards.setTranslation( -offset * (numerator - 1) / 2, -offset * (numerator - 1) / 2 );
    }

    // add top card
    cards.addChild( cardTop );
    this.addChild( cards );
  }

  return inherit( AbstractShape, NumericSimplifiedShape, {
    getCardNode: function( width, height ) {
      return new Node( {children: [new Rectangle( -width / 2, -height / 2, width, height, 5, 5, {fill: 'white', stroke: 'black', lineWidth: 1} )]} );
    }
  } );
} );<commit_msg>fixed bug with visual representation of card<commit_after>// Copyright 2002-2013, University of Colorado Boulder

/**
 * Card shape for the 'Build a Fraction' sim.
 * Expected denominator equal to 1.
 *
 * @author <NAME> (Mlearner)
 */

define( function( require ) {
  "use strict";

  // imports
  var inherit = require( 'PHET_CORE/inherit' ),
    Node = require( 'SCENERY/nodes/Node' ),
    AbstractShape = require( 'FRACTION_COMMON/shapes/AbstractShape' ),
    Rectangle = require( 'SCENERY/nodes/Rectangle' ),
    Text = require( 'SCENERY/nodes/Text' ),
    PhetFont = require( 'SCENERY_PHET/PhetFont' );

  function NumericSimplifiedShape( options ) {
    var width,
      height,
      text,
      cardTop,
      numerator,
      cards = new Node(), // container for all cards
      offset = 3;

    AbstractShape.call( this, options );
    options = this.options;
    numerator = options.numerator;
    width = options.width;
    height = width * 1.43;

    // create top card with number
    cardTop = this.getCardNode( width, height );
    text = new Text( numerator, {centerX: 0, centerY: 0, font: new PhetFont( { size: options.width, weight: 'bold'} )} );
    cardTop.addChild( text );

    if ( options.deck ) {
      // add all cards except top one
      for ( var i = 0; i < numerator - 1; i++ ) {
        cards.addChild( this.getCardNode( width, height ).setTranslation( offset * i, offset * i ) );
      }

      // set translations
      cardTop.setTranslation( offset * (numerator - 1), offset * (numerator - 1) );
      cards.setTranslation( -offset * (numerator - 1) / 2, -offset * (numerator - 1) / 2 );
    }

    // add top card
    cards.addChild( cardTop );
    this.addChild( cards );
  }

  return inherit( AbstractShape, NumericSimplifiedShape, {
    getCardNode: function( width, height ) {
      return new Node( {children: [new Rectangle( -width / 2, -height / 2, width, height, width / 10, width / 10, {fill: 'white', stroke: 'black', lineWidth: 1} )]} );
    }
  } );
} );
{'fraction_non_alphanumeric': 0.1378021430351358, 'fraction_numerical': 0.0149514079242462, 'mean_word_length': 2.696132596685083, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5487084', 'n_tokens_mistral': 1346, 'n_tokens_neox': 1268, 'n_words': 375}