r21639 by jghali - #14452: Grid on Master Pages not drawn if master pages count is even
scribus-commit
scribus-commit at lists.scribus.net
Sun Dec 11 19:32:52 UTC 2016
Author: jghali
Date: Sun Dec 11 19:32:52 2016
New Revision: 21639
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21639
Log:
#14452: Grid on Master Pages not drawn if master pages count is even
Modified:
trunk/Scribus/scribus/canvas.cpp
Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21639&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Sun Dec 11 19:32:52 2016
@@ -1725,15 +1725,23 @@
void Canvas::getClipPathForPages(FPointArray* PoLine)
{
PoLine->resize(0);
- uint docPagesCount=m_doc->Pages->count();
bool first = true;
ScPage *actPg;
- for (int a = 0; a < static_cast<int>(docPagesCount); ++a)
+
+ int firstPage = 0;
+ int lastPage = m_doc->Pages->count();
+ if (m_doc->Pages == &m_doc->MasterPages)
+ {
+ firstPage = m_doc->currentPage()->pageNr();
+ lastPage = firstPage + 1;
+ }
+
+ for (int i = firstPage; i < lastPage; ++i)
{
if (!first)
PoLine->setMarker();
first = false;
- actPg = m_doc->Pages->at(a);
+ actPg = m_doc->Pages->at(i);
double x = actPg->xOffset();
double y = actPg->yOffset();
double w = actPg->width();
@@ -1741,10 +1749,10 @@
static double rect[] = {0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0};
- for (int a = 0; a < 29; a += 4)
- {
- PoLine->addPoint(x + w * rect[a], y + h * rect[a+1]);
- PoLine->addPoint(x + w * rect[a+2], y + h * rect[a+3]);
+ for (int j = 0; j < 29; j += 4)
+ {
+ PoLine->addPoint(x + w * rect[j], y + h * rect[j+1]);
+ PoLine->addPoint(x + w * rect[j+2], y + h * rect[j+3]);
}
}
}
More information about the scribus-commit
mailing list