Skip to content

Commit

Permalink
Partial fix for issue lojjic#79: explicitly set the size of the backg…
Browse files Browse the repository at this point in the history
…round image fill tile in pixels so that IE will automatically adjust it to the user's zoom level.
  • Loading branch information
Jason Johnston committed Sep 5, 2011
1 parent 401e817 commit d97c930
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sources/BackgroundRenderer.js
Expand Up @@ -153,6 +153,11 @@ PIE.BackgroundRenderer = PIE.RendererBase.newRenderer( {
pxY = Math.round( bgPos.y ) + bwT + 0.5;
fill.position = ( pxX / elW ) + ',' + ( pxY / elH );

// Set the size of the image. We have to actually set it to px values otherwise it will not honor
// the user's browser zoom level and always display at its natural screen size.
fill['size']['x'] = 1; //Can be any value, just has to be set to "prime" it so the next line works. Weird!
fill['size'] = size.w + 'px,' + size.h + 'px';

// Repeating - clip the image shape
if( repeat && repeat !== 'repeat' ) {
if( repeat === 'repeat-x' || repeat === 'no-repeat' ) {
Expand Down

0 comments on commit d97c930

Please sign in to comment.