Project: titanium
Issue TIMOB-19767: iOS: toImage does not honor the scale factor for retina devices
We used to have a {{honorScaleFactor}} property, that was removed as part of the 4.0.0.GA release in [this PR|https://github.com/appcelerator/titanium_mobile/pull/6302] around changes with non-attached images. The [docs|http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ImageView-method-toImage] say, the property was already removed in 3.5.0, but worked until 3.5.1.GA. I would like to get this property back to achieve a proper behavior in the following use case. *Use case*: Use {{toImage()}} to make an image (blob) of a view, that covers a specified square inside another view. *Demo:* {code:javascript} var win1 = Titanium.UI.createWindow({	backgroundColor : '#fff' }); var imageView = Ti.UI.createImageView({	image : "test.jpg" }); imageView.addEventListener("click", imageViewClicked); win1.add(imageView); win1.open(); function imageViewClicked(e) {	imageView.removeEventListener("click", imageViewClicked);	var edgeLength = 100;	var blob = imageView.toImage();	var tempView = Ti.UI.createView({	width : blob.width + edgeLength,	height : blob.height + edgeLength	});	tempView.add(Ti.UI.createImageView({	image : blob,	width : blob.width,	height : blob.height	})); // No callback -> get blob directly, honorScaleFactor false -> Same size for retina and non-retina // Default functionality still the same: No callback and secons argument true / undefined -> Different size for retina and non-retina	blob = tempView.toImage(null, false);	var image = blob.imageAsCropped({	width : edgeLength,	height : edgeLength,	x : e.x,	y : e.y	});	var croppedImageView = Ti.UI.createImageView({	image : image,	bottom : 0,	borderWidth : 1,	borderColor : "black",	borderRadius : edgeLength / 2	});	croppedImageView.addEventListener("click", function() {	win1.remove(croppedImageView);	imageView.addEventListener("click", imageViewClicked);	});	win1.add(croppedImageView); } {code} *Expected behavior*: The method works same on retina and non-retina devices. *Actual behavior:* The method uses the wrong scale on creating the image blob. *Proposal*: Bring back the {{honorScaleFactor}} property, make the default value to {{true}} as the current behavior expects. That would achieve the configuration of the property, but would not break any existing applications.
Story points: 3