<commit_before>package h2d;

class Mask extends Sprite {

	public var width : Int;
	public var height : Int;

	public function new(width, height, ?parent) {
		super(parent);
		this.width = width;
		this.height = height;
	}

	override function getBoundsRec( relativeTo, out ) {
		super.getBoundsRec(relativeTo, out);
		var xMin = out.xMin, yMin = out.yMin, xMax = out.xMax, yMax = out.yMax;
		out.empty();
		addBounds(relativeTo, out, 0, 0, width, height);
		if( xMin > out.xMin ) out.xMin = xMin;
		if( yMin > out.yMin ) out.yMin = yMin;
		if( xMax < out.xMax ) out.xMax = xMax;
		if( yMax < out.yMax ) out.yMax = yMax;
	}

	override function drawRec( ctx : h2d.RenderContext ) {

		var x1 = (absX + 1) * 0.5 * ctx.engine.width;
		var y1 = (1 - absY) * 0.5 * ctx.engine.height;

		var x2 = ((width * matA + height * matC + absX) + 1) * 0.5 * ctx.engine.width;
		var y2 = (1 - (width * matB + height * matD + absY)) * 0.5 * ctx.engine.height;

		ctx.engine.setRenderZone(Std.int(x1+1e-10), Std.int(y1+1e-10), Std.int(x2-x1+1e-10), Std.int(y2-y1+1e-10));
		super.drawRec(ctx);
		ctx.engine.setRenderZone();
	}

}<commit_msg>fix Mask for heaps<commit_after>package h2d;

class Mask extends Sprite {

	public var width : Int;
	public var height : Int;

	public function new(width, height, ?parent) {
		super(parent);
		this.width = width;
		this.height = height;
	}

	override function getBoundsRec( relativeTo, out ) {
		super.getBoundsRec(relativeTo, out);
		var xMin = out.xMin, yMin = out.yMin, xMax = out.xMax, yMax = out.yMax;
		out.empty();
		addBounds(relativeTo, out, 0, 0, width, height);
		if( xMin > out.xMin ) out.xMin = xMin;
		if( yMin > out.yMin ) out.yMin = yMin;
		if( xMax < out.xMax ) out.xMax = xMax;
		if( yMax < out.yMax ) out.yMax = yMax;
	}

	override function drawRec( ctx : h2d.RenderContext ) {

		var x1 = (absX + 1) * 0.5 * ctx.engine.width;
		var y1 = (1 - absY) * 0.5 * ctx.engine.height;

		var x2 = ((width * matA + height * matC + absX) + 1) * 0.5 * ctx.engine.width;
		var y2 = (1 - (width * matB + height * matD + absY)) * 0.5 * ctx.engine.height;

		ctx.flush();
		ctx.engine.setRenderZone(Std.int(x1+1e-10), Std.int(y1+1e-10), Std.int(x2-x1+1e-10), Std.int(y2-y1+1e-10));
		super.drawRec(ctx);
		ctx.flush();
		ctx.engine.setRenderZone();
	}

}
{'fraction_non_alphanumeric': 0.16586222027204914, 'fraction_numerical': 0.03334795963141729, 'mean_word_length': 3.2379182156133828, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1241557', 'n_tokens_mistral': 1029, 'n_tokens_neox': 951, 'n_words': 225}