r17061 by fschmid - Fixed Contourline editing for flipped groups and also fixed textflow for flipped groups.
scribus-commit
scribus-commit at lists.scribus.net
Sun Dec 4 20:51:03 UTC 2011
Author: fschmid
Date: Sun Dec 4 20:51:03 2011
New Revision: 17061
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17061
Log:
Fixed Contourline editing for flipped groups and also fixed textflow for flipped groups.
Modified:
trunk/Scribus/scribus/canvasmode.cpp
trunk/Scribus/scribus/canvasmode_nodeedit.cpp
trunk/Scribus/scribus/pageitem_textframe.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
trunk/Scribus/scribus/scribusdoc.cpp
Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17061&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Sun Dec 4 20:51:03 2011
@@ -1236,7 +1236,7 @@
if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
{
QPolygonF poly;
- if ((currItem->imageFlippedH()) && (currItem->isSymbol() || currItem->isGroup()))
+ if ((currItem->imageFlippedH() && (!m_doc->nodeEdit.isContourLine)) && (currItem->isSymbol() || currItem->isGroup()))
moveBy *= -1;
for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
{
@@ -1307,7 +1307,7 @@
if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
{
QPolygonF poly;
- if ((currItem->imageFlippedH()) && (currItem->isSymbol() || currItem->isGroup()))
+ if ((currItem->imageFlippedH() && (!m_doc->nodeEdit.isContourLine)) && (currItem->isSymbol() || currItem->isGroup()))
moveBy *= -1;
for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
{
@@ -1378,7 +1378,7 @@
if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
{
QPolygonF poly;
- if ((currItem->imageFlippedV()) && (currItem->isSymbol() || currItem->isGroup()))
+ if ((currItem->imageFlippedV() && (!m_doc->nodeEdit.isContourLine)) && (currItem->isSymbol() || currItem->isGroup()))
moveBy *= -1;
for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
{
@@ -1449,7 +1449,7 @@
if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
{
QPolygonF poly;
- if ((currItem->imageFlippedV()) && (currItem->isSymbol() || currItem->isGroup()))
+ if ((currItem->imageFlippedV() && (!m_doc->nodeEdit.isContourLine)) && (currItem->isSymbol() || currItem->isGroup()))
moveBy *= -1;
for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
{
Modified: trunk/Scribus/scribus/canvasmode_nodeedit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17061&path=/trunk/Scribus/scribus/canvasmode_nodeedit.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_nodeedit.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_nodeedit.cpp Sun Dec 4 20:51:03 2011
@@ -61,26 +61,28 @@
p->scale(m_canvas->scale(), m_canvas->scale());
p->translate(-m_doc->minCanvasCoordinate.x(), -m_doc->minCanvasCoordinate.y());
p->setTransform(currItem->getTransform(), true);
- if (currItem->isSymbol() || currItem->isGroup())
- {
- if (currItem->imageFlippedH())
- {
- p->translate(currItem->width(), 0);
- p->scale(-1, 1);
- }
- if (currItem->imageFlippedV())
- {
- p->translate(0, currItem->height());
- p->scale(1, -1);
- }
- }
p->setPen(QPen(Qt::blue, 1 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
p->setBrush(Qt::NoBrush);
if ((m_doc->nodeEdit.isContourLine) && (currItem->ContourLine.size() != 0))
cli = currItem->ContourLine;
else
+ {
cli = currItem->PoLine;
+ if (currItem->isSymbol() || currItem->isGroup())
+ {
+ if (currItem->imageFlippedH())
+ {
+ p->translate(currItem->width(), 0);
+ p->scale(-1, 1);
+ }
+ if (currItem->imageFlippedV())
+ {
+ p->translate(0, currItem->height());
+ p->scale(1, -1);
+ }
+ }
+ }
// draw curve
const double scale = m_canvas->m_viewMode.scale;
const double onePerScale = 1 / scale;
@@ -173,22 +175,24 @@
QRectF Sele = m_rectangleSelect->result();
FPointArray Clip;
bool firstPoint = false;
+ QTransform pm2 = currItem->getTransform();
if (m_doc->nodeEdit.isContourLine)
Clip = currItem->ContourLine;
else
+ {
Clip = currItem->PoLine;
- QTransform pm2 = currItem->getTransform();
- if (currItem->isSymbol() || currItem->isGroup())
- {
- if (currItem->imageFlippedH())
- {
- pm2.translate(currItem->width(), 0);
- pm2.scale(-1, 1);
- }
- if (currItem->imageFlippedV())
- {
- pm2.translate(0, currItem->height());
- pm2.scale(1, -1);
+ if (currItem->isSymbol() || currItem->isGroup())
+ {
+ if (currItem->imageFlippedH())
+ {
+ pm2.translate(currItem->width(), 0);
+ pm2.scale(-1, 1);
+ }
+ if (currItem->imageFlippedV())
+ {
+ pm2.translate(0, currItem->height());
+ pm2.scale(1, -1);
+ }
}
}
for (uint a = 0; a < Clip.size(); ++a)
@@ -409,10 +413,6 @@
currItem->OldB2 = currItem->width();
currItem->OldH2 = currItem->height();
FPointArray Clip;
- if (m_doc->nodeEdit.isContourLine)
- Clip = currItem->ContourLine;
- else
- Clip = currItem->PoLine;
FPoint npf;
double nx = newP.x();
double ny = newP.y();
@@ -422,21 +422,27 @@
npf = FPoint(nx, ny);
QTransform pp = currItem->getTransform();
npf = npf.transformPoint(pp, true);
- if (currItem->isSymbol() || currItem->isGroup())
- {
- if (currItem->imageFlippedH())
- {
- QTransform p;
- p.translate(currItem->width(), 0);
- p.scale(-1, 1);
- npf = npf.transformPoint(p, false);
- }
- if (currItem->imageFlippedV())
- {
- QTransform p;
- p.translate(0, currItem->height());
- p.scale(1, -1);
- npf = npf.transformPoint(p, false);
+ if (m_doc->nodeEdit.isContourLine)
+ Clip = currItem->ContourLine;
+ else
+ {
+ Clip = currItem->PoLine;
+ if (currItem->isSymbol() || currItem->isGroup())
+ {
+ if (currItem->imageFlippedH())
+ {
+ QTransform p;
+ p.translate(currItem->width(), 0);
+ p.scale(-1, 1);
+ npf = npf.transformPoint(p, false);
+ }
+ if (currItem->imageFlippedV())
+ {
+ QTransform p;
+ p.translate(0, currItem->height());
+ p.scale(1, -1);
+ npf = npf.transformPoint(p, false);
+ }
}
}
m_doc->nodeEdit.moveClipPoint(currItem, npf);
@@ -500,7 +506,7 @@
bool pfound = false;
QTransform pm2 = currItem->getTransform();
npf2 = m_canvas->globalToCanvas(m->globalPos()).transformPoint(pm2, true);
- if (currItem->isSymbol() || currItem->isGroup())
+ if ((currItem->isSymbol() || currItem->isGroup()) && (!m_doc->nodeEdit.isContourLine))
{
if (currItem->imageFlippedH())
{
@@ -961,7 +967,7 @@
bool CanvasMode_NodeEdit::handleNodeEditMove(QMouseEvent* m, QRect, PageItem* currItem, QTransform)
{
QTransform itemPos = currItem->getTransform();
- if (currItem->isSymbol() || currItem->isGroup())
+ if ((currItem->isSymbol() || currItem->isGroup()) && (!m_doc->nodeEdit.isContourLine))
{
if (currItem->imageFlippedH())
{
@@ -1066,7 +1072,7 @@
currItem = m_doc->m_Selection->itemAt(0);
if ((m_doc->nodeEdit.SegP1 != -1) && (m_doc->nodeEdit.SegP2 != -1))
{
- if (currItem->isSymbol() || currItem->isGroup())
+ if ((currItem->isSymbol() || currItem->isGroup()) && (!m_doc->nodeEdit.isContourLine))
{
if (currItem->imageFlippedH())
np.setX(np.x() * -1);
@@ -1104,7 +1110,7 @@
npf = FPoint(nx, ny);
QTransform pp = currItem->getTransform();
npf = npf.transformPoint(pp, true);
- if (currItem->isSymbol() || currItem->isGroup())
+ if ((currItem->isSymbol() || currItem->isGroup()) && (!m_doc->nodeEdit.isContourLine))
{
if (currItem->imageFlippedH())
{
@@ -1126,7 +1132,7 @@
}
else
{
- if (currItem->isSymbol() || currItem->isGroup())
+ if ((currItem->isSymbol() || currItem->isGroup()) && (!m_doc->nodeEdit.isContourLine))
{
if (currItem->imageFlippedH())
np.setX(np.x() * -1);
@@ -1156,7 +1162,7 @@
npf = FPoint(nx, ny);
QTransform pp = currItem->getTransform();
npf = npf.transformPoint(pp, true);
- if (currItem->isSymbol() || currItem->isGroup())
+ if ((currItem->isSymbol() || currItem->isGroup()) && (!m_doc->nodeEdit.isContourLine))
{
if (currItem->imageFlippedH())
{
Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17061&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Sun Dec 4 20:51:03 2011
@@ -113,6 +113,19 @@
}
else
{
+ if (docItem->isSymbol() || docItem->isGroup())
+ {
+ if (docItem->imageFlippedH())
+ {
+ pp.translate(docItem->width(), 0);
+ pp.scale(-1, 1);
+ }
+ if (docItem->imageFlippedV())
+ {
+ pp.translate(0, docItem->height());
+ pp.scale(1, -1);
+ }
+ }
if ((((docItem->lineColor() != CommonStrings::None) || (!docItem->patternStrokeVal.isEmpty()) || (docItem->GrTypeStroke > 0)) && (docItem->lineWidth() > 1)) || (!docItem->NamedLStyle.isEmpty()))
{
QVector<double> m_array;
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17061&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Sun Dec 4 20:51:03 2011
@@ -4234,7 +4234,10 @@
}
}
else if (attrs.hasAttribute("copath"))
+ {
+ currItem->ContourLine.resize(0);
currItem->ContourLine.parseSVG(attrs.valueAsString("copath"));
+ }
else
currItem->ContourLine = currItem->PoLine.copy();
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17061&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sun Dec 4 20:51:03 2011
@@ -9532,6 +9532,23 @@
break;
default:
item->SetFrameShape(count, points);
+ if (item->isSymbol() || item->isGroup())
+ {
+ if (item->imageFlippedH())
+ {
+ QTransform ma;
+ ma.scale(-1, 1);
+ item->PoLine.map(ma);
+ item->PoLine.translate(item->width(), 0);
+ }
+ if (item->imageFlippedV())
+ {
+ QTransform ma;
+ ma.scale(1, -1);
+ item->PoLine.map(ma);
+ item->PoLine.translate(0, item->height());
+ }
+ }
this->setRedrawBounding(item);
item->FrameType = frameType + 2;
break;
@@ -13708,13 +13725,9 @@
currItem->ClipEdited = true;
FPointArray Clip;
if (isContourLine)
- {
Clip = currItem->ContourLine.copy();
- }
else
- {
Clip = currItem->PoLine.copy();
- }
currItem->FrameType = 3;
uint EndInd = Clip.size();
uint StartInd = 0;
More information about the scribus-commit
mailing list