Implement continuous tape labels and path-based label shapes.
- Added "roll" as a special paper id - Added roll_width attribute to draw tape in previews - Updated Brother QL-500/* label templates - Preserve print dialog settings between print jobs. - Added path based labels for arbitrary shaped labels. - Fleshed out implementation of continuous labels.
This commit is contained in:
+25
-14
@@ -44,16 +44,7 @@ namespace glabels
|
||||
mR.pt(), mR.pt() );
|
||||
}
|
||||
|
||||
|
||||
FrameRect::FrameRect( const FrameRect &other )
|
||||
: Frame(other),
|
||||
mW(other.mW), mH(other.mH), mR(other.mR), mXWaste(other.mXWaste),
|
||||
mYWaste(other.mYWaste), mPath(other.mPath)
|
||||
{
|
||||
// empty
|
||||
}
|
||||
|
||||
|
||||
Frame* FrameRect::dup() const
|
||||
{
|
||||
return new FrameRect( *this );
|
||||
@@ -138,14 +129,15 @@ namespace glabels
|
||||
}
|
||||
|
||||
|
||||
QPainterPath FrameRect::marginPath( const Distance& size ) const
|
||||
QPainterPath FrameRect::marginPath( const Distance& xSize,
|
||||
const Distance& ySize ) const
|
||||
{
|
||||
Distance w = mW - 2*size;
|
||||
Distance h = mH - 2*size;
|
||||
Distance r = std::max( mR - size, Distance(0.0) );
|
||||
Distance w = mW - 2*xSize;
|
||||
Distance h = mH - 2*ySize;
|
||||
Distance r = std::max( mR - std::min(xSize, ySize), Distance(0.0) );
|
||||
|
||||
QPainterPath path;
|
||||
path.addRoundedRect( size.pt(), size.pt(), w.pt(), h.pt(), r.pt(), r.pt() );
|
||||
path.addRoundedRect( xSize.pt(), ySize.pt(), w.pt(), h.pt(), r.pt(), r.pt() );
|
||||
|
||||
return path;
|
||||
}
|
||||
@@ -153,3 +145,22 @@ namespace glabels
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QDebug operator<<( QDebug dbg, const glabels::model::FrameRect& frame )
|
||||
{
|
||||
QDebugStateSaver saver(dbg);
|
||||
|
||||
dbg.nospace() << "FrameRect{ "
|
||||
<< frame.id() << ","
|
||||
<< frame.w() << ","
|
||||
<< frame.h() << ","
|
||||
<< frame.r() << ","
|
||||
<< frame.xWaste() << ","
|
||||
<< frame.yWaste() << ","
|
||||
<< frame.layouts() << ","
|
||||
<< frame.markups()
|
||||
<< " }";
|
||||
|
||||
return dbg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user