Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Partial fix for issue #79: explicitly set the size of the background …
Browse files Browse the repository at this point in the history
…image fill tile in pixels so that IE will automatically adjust it to the user's zoom level.
  • Loading branch information
Jason Johnston authored and lojjic committed Feb 5, 2012
1 parent afefebf commit 9799198
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 9799198

Please sign in to comment.