<commit_before>define(["Ti/_/declare", "Ti/_/UI/Widget", "Ti/_/dom", "Ti/_/css", "Ti/_/style", "Ti/_/lang", "Ti/UI"], 
	function(declare, Widget, dom, css, style, lang, UI) {

	var setStyle = style.set,
		unitize = dom.unitize;

	return declare("Ti.UI.Slider", Widget, {

		constructor: function(args) {
			this._track = dom.create("div", {
				className: "TiUISliderTrack"
			}, this.domNode);
			
			this._thumb = dom.create("div", {
				className: "TiUIElementGradient TiUISliderThumb"
			}, this.domNode);
			
			var initialPosition,
				initialValue,
				self = this;
			this.addEventListener("touchstart", function(e) {
				initialPosition = e.x;
				initialValue = self.value;
			});
			this.addEventListener("touchmove", function(e) {
				self.value = (e.x - initialPosition) * (self.max - self.min) / (self.domNode.clientWidth - 30) + initialValue;
			});
		},
		
		_doLayout: function() {
			var dimensions = Widget.prototype._doLayout.apply(this,arguments);
			this._updateSize();
			return dimensions;	
		},
		
		_updateSize: function() {
			this._thumbLocation = Math.round((this.domNode.clientWidth - 30) * this.value / (this.max - this.min))
			setStyle(this._thumb, "transform", "translateX(" + this._thumbLocation + "px)");
		},
		
		_constrainValue: function(value) {
			var minVal = lang.val(this.minRange, this.min),
				maxVal = lang.val(this.maxRange, this.max);
			value < minVal && (value = minVal);
			value > maxVal && (value = maxVal);
			return value;
		},
		
		_defaultWidth: UI.FILL,<commit_msg>[TIMOB-7879] Fixed boundary condition check.<commit_after>define(["Ti/_/declare", "Ti/_/UI/Widget", "Ti/_/dom", "Ti/_/css", "Ti/_/style", "Ti/_/lang", "Ti/UI"], 
	function(declare, Widget, dom, css, style, lang, UI) {

	var setStyle = style.set,
		unitize = dom.unitize;

	return declare("Ti.UI.Slider", Widget, {

		constructor: function(args) {
			this._track = dom.create("div", {
				className: "TiUISliderTrack"
			}, this.domNode);
			
			this._thumb = dom.create("div", {
				className: "TiUIElementGradient TiUISliderThumb"
			}, this.domNode);
			
			var initialPosition,
				initialValue,
				self = this;
			this.addEventListener("touchstart", function(e) {
				initialPosition = e.x;
				initialValue = self.value;
			});
			this.addEventListener("touchmove", function(e) {
				self.value = Math.round((e.x - initialPosition) * (self.max - self.min) / (self.domNode.clientWidth - 30) + initialValue);
			});
		},
		
		_doLayout: function() {
			var dimensions = Widget.prototype._doLayout.apply(this,arguments);
			this._updateSize();
			return dimensions;	
		},
		
		_updateSize: function() {
			this._thumbLocation = Math.round((this.domNode.clientWidth - 30) * ((this.value - this.min) / (this.max - this.min)))
			setStyle(this._thumb, "transform", "translateX(" + this._thumbLocation + "px)");
		},
		
		_constrainValue: function(value) {
			var minVal = lang.val(this.minRange, this.min),
				maxVal = lang.val(this.maxRange, this.max);
			value < minVal && (value = minVal);
			value > maxVal && (value = maxVal);
			return value;
		},
		
		_defaultWidth: UI.FILL,
{'fraction_non_alphanumeric': 0.16763191763191762, 'fraction_numerical': 0.003861003861003861, 'mean_word_length': 3.4927745664739884, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7538249', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1046, 'n_words': 200}