<commit_before>var paper = require('prototypo.js').paper;

function wheelHandler( event ) {
	var bcr = this.canvas.getBoundingClientRect(),
		currPos = new paper.Point(
			event.clientX - bcr.left,
			event.clientY - bcr.top
		),
		viewPos = this.view.viewToProject( currPos ),
		// normalize the deltaY value. Expected values are ~40 pixels or 3 lines
		factor = 1 + ( this.opts.zoomFactor *
			( Math.abs( event.deltaY / event.deltaMode ? 3 : 40 * 20 ) ) ),
		newZoom =
			event.deltaY < 0 ?
				this.view.zoom * factor :
				event.deltaY > 0 ?
					this.view.zoom / factor :
					this.view.zoom,
		beta = this.view.zoom / newZoom,
		difference = viewPos.subtract( this.view.center ),
		newCenter = viewPos.subtract( difference.multiply(beta) );

	this.zoom = newZoom;
	this.view.center = newCenter;

	event.preventDefault();
}

function moveHandler(event) {
	if ( !this.isMousedown ) {
		return;
	}

	var currPos = new paper.Point( event.clientX, event.clientY ),<commit_msg>partition zoom and avoid to much dezoom<commit_after>var paper = require('prototypo.js').paper;

function wheelHandler( event ) {
	// normalize the deltaY value. Expected values are ~40 pixels or 3 lines
	var factor = 1 + ( this.opts.zoomFactor *
			( Math.abs( event.deltaY / event.deltaMode ? 3 : 40 * 20 ) ) ),
		newZoom =
			event.deltaY < 0 ?
				this.view.zoom * factor :
				event.deltaY > 0 ?
					this.view.zoom / factor :
					this.view.zoom;
		

	if ( newZoom > 0.07 ) {
		var mousePosition = new paper.Point( event.offsetX, event.offsetY );
		var viewPosition = this.view.viewToProject( mousePosition );
		var pc = viewPosition.subtract( this.view.center );
		var newPosition = viewPosition.subtract(
			pc.multiply( this.view.zoom / newZoom )
		).subtract( this.view.center );

		this.zoom = newZoom;
		this.view.center = this.view.center.add(newPosition);
	}

	event.preventDefault();
}

function moveHandler(event) {
	if ( !this.isMousedown ) {
		return;
	}

	var currPos = new paper.Point( event.clientX, event.clientY ),
{'fraction_non_alphanumeric': 0.13002481389578163, 'fraction_numerical': 0.01240694789081886, 'mean_word_length': 3.235294117647059, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3798827', 'n_tokens_mistral': 777, 'n_tokens_neox': 682, 'n_words': 160}