mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 11:20:09 +00:00 
			
		
		
		
	fixed zooming, some render problems in webkit (zoom did not have these\!); we are still getting some positioning errors due to sub-pizel accumolation, find a way around this...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									27f0e9e302
								
							
						
					
					
						commit
						7bfb96c1c0
					
				
							
								
								
									
										25
									
								
								ui/ui.js
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								ui/ui.js
									
									
									
									
									
								
							| @ -201,19 +201,28 @@ function fieldSize(W, H){ | |||||||
| 
 | 
 | ||||||
| /*********************************************************************/ | /*********************************************************************/ | ||||||
| 
 | 
 | ||||||
| // NOTE: this will only return a single scale/zoom value...
 | // NOTE: this will only return a single scale value...
 | ||||||
| function getElementScale(elem){ | function getElementScale(elem){ | ||||||
| 	var zoom = elem.css('zoom') | 	//var transform = elem.css('transform')
 | ||||||
|  | 	var vendors = ['o', 'moz', 'ms', 'webkit'] | ||||||
| 	var transform = elem.css('transform') | 	var transform = elem.css('transform') | ||||||
| 	var res | 	var res | ||||||
| 
 | 
 | ||||||
| 	// get the scale value...
 | 	// go through vendor prefixes... (hate this!)
 | ||||||
| 	if( (/scale\(/).test(transform) ){ | 	if(!transform || transform == 'none'){ | ||||||
| 		res = (/scale\((.*),.*\)/).exec(transform)[1] | 		for(var i in vendors){ | ||||||
| 	} else { | 			transform = elem.css('-' + vendors[i] + '-transform') | ||||||
| 		res = zoom | 			if(transform && transform != 'none'){ | ||||||
|  | 				break | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
| 	} | 	} | ||||||
| 	return res | 	// no transform is set...
 | ||||||
|  | 	if(!transform || transform == 'none'){ | ||||||
|  | 		return 1 | ||||||
|  | 	} | ||||||
|  | 	// get the scale value -- first argument of scale/matrix...
 | ||||||
|  | 	return parseFloat((/(scale|matrix)\(([^,]*),.*\)/).exec(transform)[2]) | ||||||
| } | } | ||||||
| // XXX
 | // XXX
 | ||||||
| function setElementScale(elem, scale){ | function setElementScale(elem, scale){ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user