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 -13
View File
@@ -21,7 +21,6 @@
#ifndef libglabels_Markup_h
#define libglabels_Markup_h
#include <QGraphicsItem>
#include <QPainterPath>
#include "Frame.h"
@@ -34,22 +33,25 @@ namespace libglabels
{
public:
virtual Markup* dup() const = 0;
virtual QGraphicsItem* createGraphicsItem( const Frame* frame, const QPen& pen ) const = 0;
const QPainterPath& path() const;
protected:
QPainterPath mPath;
};
class MarkupMargin : public Markup
{
public:
MarkupMargin( double size );
MarkupMargin( const Frame* frame, double size );
double size() const;
Markup* dup() const;
QGraphicsItem* createGraphicsItem( const Frame* frame, const QPen& pen ) const;
private:
const Frame* mFrame;
double mSize;
};
@@ -66,8 +68,6 @@ namespace libglabels
Markup* dup() const;
QGraphicsItem* createGraphicsItem( const Frame* frame, const QPen& pen ) const;
private:
double mX1;
double mY1;
@@ -89,8 +89,6 @@ namespace libglabels
Markup* dup() const;
QGraphicsItem* createGraphicsItem( const Frame* frame, const QPen& pen ) const;
private:
double mX1;
double mY1;
@@ -112,8 +110,6 @@ namespace libglabels
Markup* dup() const;
QGraphicsItem* createGraphicsItem( const Frame* frame, const QPen& pen ) const;
private:
double mX1;
double mY1;
@@ -133,8 +129,6 @@ namespace libglabels
Markup* dup() const;
QGraphicsItem* createGraphicsItem( const Frame* frame, const QPen& pen ) const;
private:
double mX0;
double mY0;