Skip to content

Commit

Permalink
fixed zero dpi on background image when image goes oversize in cell and
Browse files Browse the repository at this point in the history
switch back to no repeat for background image drawing on no edit
  • Loading branch information
sguan-actuate committed Jul 9, 2014
1 parent 6758698 commit f8fe753
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Expand Up @@ -465,8 +465,9 @@ private void fillRectangleWithImage( ImagePart imageInfo, int x, int y,
writer.attribute( "prst", "rect" );
writer.closeTag( "a:prstGeom" );

setBackgroundImg( imageInfo.getPart( ).getRelationshipId( ), offsetX, offsetY );
//hardcore the repeat type
setBackgroundImg( imageInfo.getPart( ).getRelationshipId( ), offsetX,
offsetY, BackgroundImageInfo.NO_REPEAT );
// hardcore the repeat type
writer.openTag( "a:ln" );
writer.openTag( "a:noFill" );
writer.closeTag( "a:noFill" );
Expand All @@ -475,12 +476,15 @@ private void fillRectangleWithImage( ImagePart imageInfo, int x, int y,
writer.closeTag( "p:sp" );
}

public void setBackgroundImg( String relationshipid, int offsetX, int offsetY )
public void setBackgroundImg( String relationshipid, int offsetX,
int offsetY )
{
setBackgroundImg( relationshipid, offsetX, offsetY, BackgroundImageInfo.REPEAT);
setBackgroundImg( relationshipid, offsetX, offsetY,
BackgroundImageInfo.REPEAT );
}

public void setBackgroundImg( String relationshipid, int offsetX, int offsetY, int repeatmode )

public void setBackgroundImg( String relationshipid, int offsetX,
int offsetY, int repeatmode )
{
if ( repeatmode < BackgroundImageInfo.NO_REPEAT
|| repeatmode > BackgroundImageInfo.REPEAT
Expand Down
Expand Up @@ -50,8 +50,9 @@ public static String parseStyle( int style )
public static int pixelToEmu( int pixels, int dpi )
{
if ( dpi == 0 )
return 0;

{//default resolution:
dpi = 96;
}
return pixels * (int) ( (float) 914400 / dpi );

}
Expand Down

0 comments on commit f8fe753

Please sign in to comment.