mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +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){
|
||||
var zoom = elem.css('zoom')
|
||||
//var transform = elem.css('transform')
|
||||
var vendors = ['o', 'moz', 'ms', 'webkit']
|
||||
var transform = elem.css('transform')
|
||||
var res
|
||||
|
||||
// get the scale value...
|
||||
if( (/scale\(/).test(transform) ){
|
||||
res = (/scale\((.*),.*\)/).exec(transform)[1]
|
||||
} else {
|
||||
res = zoom
|
||||
// go through vendor prefixes... (hate this!)
|
||||
if(!transform || transform == 'none'){
|
||||
for(var i in vendors){
|
||||
transform = elem.css('-' + vendors[i] + '-transform')
|
||||
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
|
||||
function setElementScale(elem, scale){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user