Refactor frame and markup code to use paths.

- CD frames are currently broken.
This commit is contained in:
Jim Evins
2015-08-12 01:20:52 -04:00
parent 0ad6caeeca
commit 721746007c
13 changed files with 110 additions and 164 deletions
+7 -7
View File
@@ -60,7 +60,7 @@ namespace libglabels
}
const QString FrameRound::sizeDescription( const Units *units ) const
const QString FrameRound::sizeDescription( const Units* units ) const
{
if ( units->id() == "in" )
{
@@ -81,7 +81,7 @@ namespace libglabels
}
bool FrameRound::isSimilarTo( Frame *other ) const
bool FrameRound::isSimilarTo( Frame* other ) const
{
if ( FrameRound *otherRound = dynamic_cast<FrameRound*>(other) )
{
@@ -94,20 +94,20 @@ namespace libglabels
}
const QPainterPath& FrameRound::path( bool isRotated ) const
const QPainterPath& FrameRound::path() const
{
return mPath;
}
QGraphicsItem* FrameRound::createMarginGraphicsItem( double size, const QPen& pen ) const
QPainterPath FrameRound::marginPath( double size ) const
{
double r = mR - size;
QGraphicsEllipseItem* item = new QGraphicsEllipseItem( mR-r, mR-r, 2*r, 2*r );
item->setPen( pen );
QPainterPath path;
path.addEllipse( size, size, 2*r, 2*r );
return item;
return path;
}
}