Initial implementation of TemplatePicker. Debugged mini previews.

This commit is contained in:
Jim Evins
2013-11-05 23:51:48 -05:00
parent fe4595bde0
commit ba83204445
11 changed files with 149 additions and 18 deletions
+9 -8
View File
@@ -70,21 +70,22 @@ namespace libglabels
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.arcMoveTo( 0, 0, 2*mR1, 2*mR1, theta1 );
mPath.arcTo( 0, 0, 2*mR1, 2*mR1, theta1, theta2-theta1 );
mPath.arcTo( 0, 0, 2*mR1, 2*mR1, 180-theta2, theta2-theta1 );
mPath.arcTo( 0, 0, 2*mR1, 2*mR1, 180+theta1, theta2-theta1 );
mPath.arcTo( 0, 0, 2*mR1, 2*mR1, 360-theta2, theta2-theta1 );
mPath.closeSubpath();
// Inner path (hole)
mPath.addEllipse( xc-mR2, yc-mR2, 2*mR2, 2*mR2 );
mPath.addEllipse( mR1-mR2, mR1-mR2, 2*mR2, 2*mR2 );
// Translate to account for offset with clipped business card CDs (applies to element already drawn)
mPath.translate( w()/2 - mR1, h()/2 - mR1 );
}
}