Skip to content
This repository
Browse code

Partial fix for issue #79: explicitly set the size of the background …

…image fill tile in pixels so that IE will automatically adjust it to the user's zoom level.
  • Loading branch information...
commit d97c93097d5ed0dc880a5d432e70ee097c9da7f9 1 parent 401e817
authored September 05, 2011

Showing 1 changed file with 5 additions and 0 deletions. Show diff stats Hide diff stats

  1. 5  sources/BackgroundRenderer.js
5  sources/BackgroundRenderer.js
@@ -153,6 +153,11 @@ PIE.BackgroundRenderer = PIE.RendererBase.newRenderer( {
153 153
                 pxY = Math.round( bgPos.y ) + bwT + 0.5;
154 154
                 fill.position = ( pxX / elW ) + ',' + ( pxY / elH );
155 155
 
  156
+                // Set the size of the image. We have to actually set it to px values otherwise it will not honor
  157
+                // the user's browser zoom level and always display at its natural screen size.
  158
+                fill['size']['x'] = 1; //Can be any value, just has to be set to "prime" it so the next line works. Weird!
  159
+                fill['size'] = size.w + 'px,' + size.h + 'px';
  160
+
156 161
                 // Repeating - clip the image shape
157 162
                 if( repeat && repeat !== 'repeat' ) {
158 163
                     if( repeat === 'repeat-x' || repeat === 'no-repeat' ) {

0 notes on commit d97c930

Please sign in to comment.
Something went wrong with that request. Please try again.