Kaydet (Commit) f7ca0e46 authored tarafından Rafael Dominguez's avatar Rafael Dominguez

Dont draw thumbnail border if theres no thumbnail to paint.

Change-Id: I6ca934ccf2e1fa34e60cae3feb1564c87e69254b
üst 22350676
...@@ -39,7 +39,10 @@ void TemplateLocalViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p ...@@ -39,7 +39,10 @@ void TemplateLocalViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
const ThumbnailItemAttributes *pAttrs) const ThumbnailItemAttributes *pAttrs)
{ {
int nCount = 0; int nCount = 0;
int nSeqSize = 7; int nSeqSize = 2;
if (!maPreview1.IsEmpty())
nSeqSize += 5;
if (!maPreview2.IsEmpty()) if (!maPreview2.IsEmpty())
nSeqSize += 5; nSeqSize += 5;
...@@ -91,28 +94,31 @@ void TemplateLocalViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p ...@@ -91,28 +94,31 @@ void TemplateLocalViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
B2DPoint(fPosX,fPosY))); B2DPoint(fPosX,fPosY)));
} }
aSeq[nCount++] = Primitive2DReference( new FillBitmapPrimitive2D( if (!maPreview1.IsEmpty())
createScaleTranslateB2DHomMatrix(fScaleX,fScaleY,aPos.X(),aPos.Y()), {
FillBitmapAttribute(maPreview1, aSeq[nCount++] = Primitive2DReference( new FillBitmapPrimitive2D(
B2DPoint(0,0), createScaleTranslateB2DHomMatrix(fScaleX,fScaleY,aPos.X(),aPos.Y()),
B2DVector(aImageSize.Width(),aImageSize.Height()), FillBitmapAttribute(maPreview1,
false) B2DPoint(0,0),
)); B2DVector(aImageSize.Width(),aImageSize.Height()),
false)
// draw thumbnail borders ));
float fWidth = aImageSize.Width()*fScaleX;
float fHeight = aImageSize.Height()*fScaleY; // draw thumbnail borders
float fPosX = aPos.getX(); float fWidth = aImageSize.Width()*fScaleX;
float fPosY = aPos.getY(); float fHeight = aImageSize.Height()*fScaleY;
float fPosX = aPos.getX();
aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY), float fPosY = aPos.getY();
B2DPoint(fPosX+fWidth,fPosY)));
aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY), aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY),
B2DPoint(fPosX+fWidth,fPosY+fHeight))); B2DPoint(fPosX+fWidth,fPosY)));
aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY+fHeight), aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY),
B2DPoint(fPosX,fPosY+fHeight))); B2DPoint(fPosX+fWidth,fPosY+fHeight)));
aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY+fHeight), aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY+fHeight),
B2DPoint(fPosX,fPosY))); B2DPoint(fPosX,fPosY+fHeight)));
aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY+fHeight),
B2DPoint(fPosX,fPosY)));
}
// Draw centered text below thumbnail // Draw centered text below thumbnail
aPos = maTextPos; aPos = maTextPos;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment