Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #308 from ycnix/master

Minor improvement to linear-gradient rendering
  • Loading branch information...
commit 1f77b88a0010d44d6918a381a1c6c02817696be2 2 parents f89a707 + ad69aaa
@lojjic authored
Showing with 10 additions and 8 deletions.
  1. +10 −8 sources/IE9BackgroundRenderer.js
View
18 sources/IE9BackgroundRenderer.js
@@ -36,14 +36,16 @@ PIE.IE9BackgroundRenderer = PIE.RendererBase.newRenderer( {
while( img = images[ i++ ] ) {
if (img.imgType === 'linear-gradient' ) {
bgAreaSize = bgInfo.getBgAreaSize( bg.bgOrigin, me.boundsInfo, styleInfos.borderInfo, styleInfos.paddingInfo );
- bgSize = ( img.bgSize || PIE.BgSize.DEFAULT ).pixels(
- me.targetElement, bgAreaSize.w, bgAreaSize.h, bgAreaSize.w, bgAreaSize.h
- );
- bg.push(
- 'url(' + me.getGradientImgData( img, bgSize.w, bgSize.h ) + ') ' +
- me.bgPositionToString( img.bgPosition ) + ' / ' + bgSize.w + 'px ' + bgSize.h + 'px ' +
- ( img.bgAttachment || '' ) + ' ' + ( img.bgOrigin || '' ) + ' ' + ( img.bgClip || '' )
- );
+ if (bgAreaSize.h > 0 && bgAreaSize.w > 0) {
+ bgSize = ( img.bgSize || PIE.BgSize.DEFAULT ).pixels(
+ me.targetElement, bgAreaSize.w, bgAreaSize.h, bgAreaSize.w, bgAreaSize.h
+ );
+ bg.push(
+ 'url(' + me.getGradientImgData( img, bgSize.w, bgSize.h ) + ') ' +
+ me.bgPositionToString( img.bgPosition ) + ' / ' + bgSize.w + 'px ' + bgSize.h + 'px ' +
+ ( img.bgAttachment || '' ) + ' ' + ( img.bgOrigin || '' ) + ' ' + ( img.bgClip || '' )
+ );
+ }
} else {
bg.push( img.origString );
}
Please sign in to comment.
Something went wrong with that request. Please try again.