Added MiniPreviewPixmap to Template.

This commit is contained in:
Jim Evins
2013-11-04 23:58:03 -05:00
parent 2843d8ccda
commit fe4595bde0
17 changed files with 263 additions and 34 deletions
+20
View File
@@ -67,5 +67,25 @@ namespace libglabels
return false;
}
void FrameCd::initPath()
{
double xc = w()/2;
double yc = h()/2;
// Outer path (may be clipped in the case business card type CD)
double theta1 = acos( w() / (2*mR1) ) * 180/M_PI;
double theta2 = asin( h() / (2*mR1) ) * 180/M_PI;
mPath.arcTo( 0, 0, 2*mR1, 2*mR1, theta1, theta2 );
mPath.arcTo( 0, 0, 2*mR1, 2*mR1, 180-theta2, 180-theta1 );
mPath.arcTo( 0, 0, 2*mR1, 2*mR1, 180+theta1, 180+theta2 );
mPath.arcTo( 0, 0, 2*mR1, 2*mR1, 360-theta2, 360-theta1 );
mPath.closeSubpath();
// Inner path (hole)
mPath.addEllipse( xc-mR2, yc-mR2, 2*mR2, 2*mR2 );
}
}