<commit_before>/**
*  Draw a rectangular region to the scene.
*/
Donatello.prototype.rect = function( x, y, w, h, a ) {
	return this.pgram( x, y, w, h, null, a );
}

Donatello.Pgram = function( parent, x, y, dx, dy, skew, a ) {
	a = Donatello.attrDefaults( a );
	var el = Donatello.createElement( x, y, dx, dy, 'div');
	
	var s = a['stroke-width'];
	var c = a['stroke'];
	var f = a['fill'];
	var style = a['stroke-style'];

	this.properties = { 
		x: x, y: y, dx: dy, skew: skew, 
		'stroke-width': s, 
		'stroke-style': style, 
		'stroke': c, 
		'fill': f
	};
	parent.dom.appendChild( el );
	this.dom = el;
	this.attr( a );
}
Donatello.Pgram.prototype = new Donatello( null );

/**
 * generalized parallelogram, used by rect.
 */
Donatello.Pgram.prototype.draw = function() {
	var el = this.dom;
	var skew = this.properties.skew;
	el.style.borderWidth = this.properties['stroke-width'] + 'px';

	if( skew != null ) {
		el.style[ Donatello.getTransform() ] += 'skew(' + skew + 'deg)';
	}
}

Donatello.prototype.pgram = function( x, y, dx, dy, skew, a ) {
	return new Donatello.Pgram( this, x, y, dx, dy, skew, a );
}<commit_msg>rect now uses w/h attrs instead of dx/dy. draw() now sets top/left/width/height according to attr()<commit_after>/**
*  Draw a rectangular region to the scene.
*/
Donatello.prototype.rect = function( x, y, w, h, a ) {
	return this.pgram( x, y, w, h, null, a );
}

Donatello.Pgram = function( parent, x, y, dx, dy, skew, a ) {
	a = Donatello.attrDefaults( a );
	var el = Donatello.createElement( x, y, dx, dy, 'div');
	
	var s = a['stroke-width'];
	var c = a['stroke'];
	var f = a['fill'];
	var style = a['stroke-style'];

	this.properties = { 
		x: x, y: y, w: dx, h: dy, skew: skew, 
		'stroke-width': s, 
		'stroke-style': style, 
		'stroke': c, 
		'fill': f
	};
	parent.dom.appendChild( el );
	this.dom = el;
	this.attr( a );
}
Donatello.Pgram.prototype = new Donatello( null );

/**
 * generalized parallelogram, used by rect.
 */
Donatello.Pgram.prototype.draw = function() {
	var el = this.dom;
	var skew = this.properties.skew;
	el.style.borderWidth = this.properties['stroke-width'] + 'px';

	if( skew != null ) {
		el.style[ Donatello.getTransform() ] += 'skew(' + skew + 'deg)';
	}

	el.style.top = this.properties.y + 'px';
	el.style.left = this.properties.x + 'px';

	el.style.width = this.properties.w + 'px';
	el.style.height = this.properties.h + 'px';
}

Donatello.prototype.pgram = function( x, y, dx, dy, skew, a ) {
	return new Donatello.Pgram( this, x, y, dx, dy, skew, a );
}
{'fraction_non_alphanumeric': 0.187797147385103, 'fraction_numerical': 0.0, 'mean_word_length': 3.391304347826087, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6373257', 'n_tokens_mistral': 1030, 'n_tokens_neox': 979, 'n_words': 276}