fixed a chrome 38 image render bug...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-11-05 03:26:29 +03:00
parent 1de1d8fa14
commit 9a903a3f7b
5 changed files with 22 additions and 4 deletions

View File

@ -491,7 +491,7 @@ function getRelativeOffset(container, block, point){
// NOTE: at this point this works only on the X axis... // NOTE: at this point this works only on the X axis...
function setElementTransform(elem, offset, scale, duration){ function setElementTransform(elem, offset, scale, duration){
elem = $(elem) elem = $(elem)
//var t3d = USE_3D_TRANSFORM ? 'translateZ(0px)' : '' //var t3d = USE_3D_TRANSFORM ? 'translateZ(0)' : ''
var t3d = USE_3D_TRANSFORM ? 'translate3d(0,0,0)' : '' var t3d = USE_3D_TRANSFORM ? 'translate3d(0,0,0)' : ''
if(offset == null){ if(offset == null){

View File

@ -247,6 +247,17 @@ module.RibbonsPrototype = {
} }
setElementScale(ribbon_set, scale) setElementScale(ribbon_set, scale)
/* XXX not sure if this is needed yet...
// XXX fix a render bug in chrome 38...
var v = this.viewer[0]
if(v.style.transform == ''){
v.style.transform = 'translateZ(0)'
} else {
v.style.transform = ''
}
*/
return this return this
}, },

View File

@ -132,6 +132,7 @@ module.GLOBAL_KEYBOARD = {
'#0': 'fitMax', '#0': 'fitMax',
'#1': { '#1': {
default: 'fitImage', default: 'fitImage',
shift: 'fitRibbon',
ctrl: 'fitOrig!', ctrl: 'fitOrig!',
}, },
'#2': 'fitTwo', '#2': 'fitTwo',
@ -145,7 +146,7 @@ module.GLOBAL_KEYBOARD = {
shift: 'fitFiveRibbons', shift: 'fitFiveRibbons',
}, },
'#6': 'fitSix', '#6': 'fitSix',
'#7': 'fitSevenr', '#7': 'fitSeven',
'#8':'fitEight', '#8':'fitEight',
'#9': 'fitNine', '#9': 'fitNine',

View File

@ -10,8 +10,6 @@
<style> <style>
</style> </style>
<script src="ext-lib/jquery.js"></script> <script src="ext-lib/jquery.js"></script>

View File

@ -1082,6 +1082,14 @@ function fitNImages(n, fixed_proportions, no_strict_fit){
setElementScale($('.ribbon-set'), scale) setElementScale($('.ribbon-set'), scale)
centerView(image, 'css') centerView(image, 'css')
// XXX fix a render bug in chrome 38...
var v = viewer[0]
if(v.style.transform == ''){
v.style.transform = 'translateZ(0)'
} else {
v.style.transform = ''
}
viewer.trigger('fittingImages', [n]) viewer.trigger('fittingImages', [n])
return scale return scale