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
const ThumbnailItemAttributes *pAttrs)
{
int nCount = 0;
int nSeqSize = 7;
int nSeqSize = 2;
if (!maPreview1.IsEmpty())
nSeqSize += 5;
if (!maPreview2.IsEmpty())
nSeqSize += 5;
......@@ -91,28 +94,31 @@ void TemplateLocalViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
B2DPoint(fPosX,fPosY)));
}
aSeq[nCount++] = Primitive2DReference( new FillBitmapPrimitive2D(
createScaleTranslateB2DHomMatrix(fScaleX,fScaleY,aPos.X(),aPos.Y()),
FillBitmapAttribute(maPreview1,
B2DPoint(0,0),
B2DVector(aImageSize.Width(),aImageSize.Height()),
false)
));
// draw thumbnail borders
float fWidth = aImageSize.Width()*fScaleX;
float fHeight = aImageSize.Height()*fScaleY;
float fPosX = aPos.getX();
float fPosY = aPos.getY();
aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY),
B2DPoint(fPosX+fWidth,fPosY)));
aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY),
B2DPoint(fPosX+fWidth,fPosY+fHeight)));
aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY+fHeight),
B2DPoint(fPosX,fPosY+fHeight)));
aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY+fHeight),
B2DPoint(fPosX,fPosY)));
if (!maPreview1.IsEmpty())
{
aSeq[nCount++] = Primitive2DReference( new FillBitmapPrimitive2D(
createScaleTranslateB2DHomMatrix(fScaleX,fScaleY,aPos.X(),aPos.Y()),
FillBitmapAttribute(maPreview1,
B2DPoint(0,0),
B2DVector(aImageSize.Width(),aImageSize.Height()),
false)
));
// draw thumbnail borders
float fWidth = aImageSize.Width()*fScaleX;
float fHeight = aImageSize.Height()*fScaleY;
float fPosX = aPos.getX();
float fPosY = aPos.getY();
aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY),
B2DPoint(fPosX+fWidth,fPosY)));
aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY),
B2DPoint(fPosX+fWidth,fPosY+fHeight)));
aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY+fHeight),
B2DPoint(fPosX,fPosY+fHeight)));
aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY+fHeight),
B2DPoint(fPosX,fPosY)));
}
// Draw centered text below thumbnail
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