mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 03:10:07 +00:00 
			
		
		
		
	minor fixes to the image crop experiemnt...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									0888315038
								
							
						
					
					
						commit
						81e375d1cc
					
				| @ -513,13 +513,14 @@ $(DIST_DIR)/$(APP_NAME)-%.msi: $(BUILD_DIR)/$(APP_NAME)-% $(BUILD_DIR)/$(APP_NAM | ||||
| 
 | ||||
| 
 | ||||
| #----------------------------------------------------------------------
 | ||||
| # Debian package...
 | ||||
| # deb/rpm package...
 | ||||
| # XXX
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| #----------------------------------------------------------------------
 | ||||
| # Mobile (cordova/PhoneGap) XXX
 | ||||
| # Mobile (cordova/PhoneGap)... 
 | ||||
| # XXX
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
| @ -101,7 +101,11 @@ $(function(){ | ||||
| 
 | ||||
| function setRatio(ratio){ | ||||
| 	var crop = $('.crop') | ||||
| 
 | ||||
| 	crop | ||||
| 		.resizable("option", "aspectRatio", ratio) | ||||
| 		// XXX this feels like a hack but it works... | ||||
| 		.data('uiResizable')._aspectRatio = ratio | ||||
| 
 | ||||
| 	if(ratio === false){ | ||||
| 		return | ||||
| @ -122,8 +126,19 @@ function setRatio(ratio){ | ||||
| function flip(){ | ||||
| 	var crop = $('.crop') | ||||
| 	var r = crop.resizable("option", "aspectRatio") | ||||
| 	r > 0  | ||||
| 		&& setRatio(1/r) | ||||
| 
 | ||||
| 	if(r > 0){ | ||||
| 		setRatio(1/r) | ||||
| 
 | ||||
| 	// no aspect ratio defined, just switch... | ||||
| 	} else { | ||||
| 		var w = crop.width() | ||||
| 		var h = crop.height() | ||||
| 
 | ||||
| 		crop | ||||
| 			.height(w) | ||||
| 			.width(h) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| </script> | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user