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:
Alex A. Naanou 2012-07-30 16:13:42 +04:00
parent 27f0e9e302
commit 7bfb96c1c0

View File

@ -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){