Improve tiled PDF.
Don't add scissors on bottom row. Users use them as quick guide where to cut before joining. Scissors on the bottom row force a user to lost information about a sheet. --HG-- branch : develop
This commit is contained in:
parent
7e1d06a9b6
commit
5aadcd067b
|
@ -26,6 +26,7 @@
|
||||||
- New options to hide all/show all visibility groups.
|
- New options to hide all/show all visibility groups.
|
||||||
- New feature "Hide piece's main path".
|
- New feature "Hide piece's main path".
|
||||||
- Allow controlling priority selecting pieces in layout.
|
- Allow controlling priority selecting pieces in layout.
|
||||||
|
- No scissors on tiled PDF bottom row.
|
||||||
|
|
||||||
# Version 0.6.2 (unreleased)
|
# Version 0.6.2 (unreleased)
|
||||||
- [#903] Bug in tool Cut Spline path.
|
- [#903] Bug in tool Cut Spline path.
|
||||||
|
|
|
@ -80,6 +80,8 @@ QVector<PosterData> VPoster::Calc(const QRect &imageRect, int page, PageOrientat
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QVector<QGraphicsItem *> VPoster::Borders(QGraphicsItem *parent, const PosterData &img, int sheets) const
|
QVector<QGraphicsItem *> VPoster::Borders(QGraphicsItem *parent, const PosterData &img, int sheets) const
|
||||||
{
|
{
|
||||||
|
SCASSERT(parent != nullptr)
|
||||||
|
|
||||||
QVector<QGraphicsItem *> data;
|
QVector<QGraphicsItem *> data;
|
||||||
QPen pen(Qt::NoBrush, 1, Qt::DashLine);
|
QPen pen(Qt::NoBrush, 1, Qt::DashLine);
|
||||||
pen.setColor(Qt::black);
|
pen.setColor(Qt::black);
|
||||||
|
@ -97,7 +99,7 @@ QVector<QGraphicsItem *> VPoster::Borders(QGraphicsItem *parent, const PosterDat
|
||||||
line->setLine(rec.x(), rec.y(), rec.x(), rec.y() + rec.height());
|
line->setLine(rec.x(), rec.y(), rec.x(), rec.y() + rec.height());
|
||||||
data.append(line);
|
data.append(line);
|
||||||
|
|
||||||
auto *scissors = new QGraphicsPixmapItem(QPixmap("://scissors_vertical.png"), parent);
|
auto *scissors = new QGraphicsPixmapItem(QPixmap(QStringLiteral("://scissors_vertical.png")), parent);
|
||||||
scissors->setPos(rec.x(), rec.y() + rec.height()-static_cast<int>(allowance));
|
scissors->setPos(rec.x(), rec.y() + rec.height()-static_cast<int>(allowance));
|
||||||
data.append(scissors);
|
data.append(scissors);
|
||||||
}
|
}
|
||||||
|
@ -118,13 +120,11 @@ QVector<QGraphicsItem *> VPoster::Borders(QGraphicsItem *parent, const PosterDat
|
||||||
line->setLine(rec.x(), rec.y(), rec.x() + rec.width(), rec.y());
|
line->setLine(rec.x(), rec.y(), rec.x() + rec.width(), rec.y());
|
||||||
data.append(line);
|
data.append(line);
|
||||||
|
|
||||||
auto *scissors = new QGraphicsPixmapItem(QPixmap("://scissors_horizontal.png"), parent);
|
auto *scissors = new QGraphicsPixmapItem(QPixmap(QStringLiteral("://scissors_horizontal.png")), parent);
|
||||||
scissors->setPos(rec.x() + rec.width()-static_cast<int>(allowance), rec.y());
|
scissors->setPos(rec.x() + rec.width()-static_cast<int>(allowance), rec.y());
|
||||||
data.append(scissors);
|
data.append(scissors);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (img.rows*img.columns > 1)
|
|
||||||
{ // Don't show bottom border if only one page need
|
|
||||||
// Bottom border (mandatory)
|
// Bottom border (mandatory)
|
||||||
auto *line = new QGraphicsLineItem(parent);
|
auto *line = new QGraphicsLineItem(parent);
|
||||||
line->setPen(pen);
|
line->setPen(pen);
|
||||||
|
@ -132,15 +132,6 @@ QVector<QGraphicsItem *> VPoster::Borders(QGraphicsItem *parent, const PosterDat
|
||||||
rec.x() + rec.width(), rec.y() + rec.height()-static_cast<int>(allowance));
|
rec.x() + rec.width(), rec.y() + rec.height()-static_cast<int>(allowance));
|
||||||
data.append(line);
|
data.append(line);
|
||||||
|
|
||||||
if (img.row == img.rows-1)
|
|
||||||
{
|
|
||||||
auto *scissors = new QGraphicsPixmapItem(QPixmap("://scissors_horizontal.png"), parent);
|
|
||||||
scissors->setPos(rec.x() + rec.width()-static_cast<int>(allowance),
|
|
||||||
rec.y() + rec.height()-static_cast<int>(allowance));
|
|
||||||
data.append(scissors);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Labels
|
// Labels
|
||||||
auto *labels = new QGraphicsTextItem(parent);
|
auto *labels = new QGraphicsTextItem(parent);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user