r16379 by fschmid - Reenabled correct display when moving Groups (was done bad with the new group code).
scribus-commit
scribus-commit at lists.scribus.net
Wed Feb 16 21:51:07 CET 2011
Author: fschmid
Date: Wed Feb 16 20:51:07 2011
New Revision: 16379
URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16379
Log:
Reenabled correct display when moving Groups (was done bad with the new group code).
Modified:
trunk/Scribus/scribus/canvas.cpp
trunk/Scribus/scribus/canvasmode.cpp
Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16379&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Wed Feb 16 20:51:07 2011
@@ -1121,42 +1121,88 @@
pp->rotate(currItem->rotation());
pp->setBrush(Qt::NoBrush);
pp->setPen(QPen(Qt::black, 1.0 / m_viewMode.scale, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin));
- if (selectedItemCount < moveWithFullOutlinesThreshold)
+ if (currItem->isGroup())
{
- if (!(currItem->asLine()))
- currItem->DrawPolyL(pp, currItem->Clip);
- else
+ PageItem_Group* gItem = currItem->asGroupFrame();
+ uint itemCountG = gItem->groupItemList.count();
+ if (itemCountG < moveWithFullOutlinesThreshold)
{
- if (currItem->asLine())
+ for (uint cg = 0; cg < itemCountG; cg++)
{
- int lw2 = 1;
- int lw = 1;
- Qt::PenCapStyle le = Qt::FlatCap;
- if (currItem->NamedLStyle.isEmpty())
- {
- if (currItem->lineColor() != CommonStrings::None)
- {
- lw2 = qRound(currItem->lineWidth() / 2.0);
- lw = qRound(qMax(currItem->lineWidth(), 1.0));
- }
- le = currItem->PLineEnd;
- }
+ currItem = gItem->groupItemList.at(cg);
+ if (!(currItem->asLine()))
+ currItem->DrawPolyL(pp, currItem->Clip);
else
{
- multiLine ml = m_doc->MLineStyles[currItem->NamedLStyle];
- lw2 = qRound(ml[ml.size()-1].Width / 2.0);
- lw = qRound(qMax(ml[ml.size()-1].Width, 1.0));
- le = static_cast<Qt::PenCapStyle>(ml[ml.size()-1].LineEnd);
+ if (currItem->asLine())
+ {
+ int lw2 = 1;
+ int lw = 1;
+ Qt::PenCapStyle le = Qt::FlatCap;
+ if (currItem->NamedLStyle.isEmpty())
+ {
+ if (currItem->lineColor() != CommonStrings::None)
+ {
+ lw2 = qRound(currItem->lineWidth() / 2.0);
+ lw = qRound(qMax(currItem->lineWidth(), 1.0));
+ }
+ le = currItem->PLineEnd;
+ }
+ else
+ {
+ multiLine ml = m_doc->MLineStyles[currItem->NamedLStyle];
+ lw2 = qRound(ml[ml.size()-1].Width / 2.0);
+ lw = qRound(qMax(ml[ml.size()-1].Width, 1.0));
+ le = static_cast<Qt::PenCapStyle>(ml[ml.size()-1].LineEnd);
+ }
+ if (le != Qt::FlatCap)
+ pp->drawRect(-lw2, -lw2, qRound(currItem->width())+lw, lw);
+ else
+ pp->drawRect(-1, -lw2, qRound(currItem->width()), lw);
+ }
}
- if (le != Qt::FlatCap)
- pp->drawRect(-lw2, -lw2, qRound(currItem->width())+lw, lw);
- else
- pp->drawRect(-1, -lw2, qRound(currItem->width()), lw);
}
}
}
else
- pp->drawRect(0, 0, static_cast<int>(currItem->width())+1, static_cast<int>(currItem->height())+1);
+ {
+ if (selectedItemCount < moveWithFullOutlinesThreshold)
+ {
+ if (!(currItem->asLine()))
+ currItem->DrawPolyL(pp, currItem->Clip);
+ else
+ {
+ if (currItem->asLine())
+ {
+ int lw2 = 1;
+ int lw = 1;
+ Qt::PenCapStyle le = Qt::FlatCap;
+ if (currItem->NamedLStyle.isEmpty())
+ {
+ if (currItem->lineColor() != CommonStrings::None)
+ {
+ lw2 = qRound(currItem->lineWidth() / 2.0);
+ lw = qRound(qMax(currItem->lineWidth(), 1.0));
+ }
+ le = currItem->PLineEnd;
+ }
+ else
+ {
+ multiLine ml = m_doc->MLineStyles[currItem->NamedLStyle];
+ lw2 = qRound(ml[ml.size()-1].Width / 2.0);
+ lw = qRound(qMax(ml[ml.size()-1].Width, 1.0));
+ le = static_cast<Qt::PenCapStyle>(ml[ml.size()-1].LineEnd);
+ }
+ if (le != Qt::FlatCap)
+ pp->drawRect(-lw2, -lw2, qRound(currItem->width())+lw, lw);
+ else
+ pp->drawRect(-1, -lw2, qRound(currItem->width()), lw);
+ }
+ }
+ }
+ else
+ pp->drawRect(0, 0, static_cast<int>(currItem->width())+1, static_cast<int>(currItem->height())+1);
+ }
pp->restore();
}
}
Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16379&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Wed Feb 16 20:51:07 2011
@@ -41,6 +41,7 @@
#ifdef GESTURE_FRAME_PREVIEW
#include "pageitempreview.h"
#endif
+#include "pageitem_group.h"
#include "prefsmanager.h"
#include "selection.h"
#include "scpainter.h"
@@ -428,19 +429,54 @@
// currItem->DrawObj(&scp, vr);
// p->drawImage(vr, img, img.rect() );
- p->save();
- p->setBrush(m_brush["outline"]);
- p->setPen(m_pen["outline"]);
- p->translate(currItem->xPos(), currItem->yPos());
- p->translate(deltax, deltay);
- if (currItem->rotation() != 0)
- {
- p->setRenderHint(QPainter::Antialiasing);
- p->rotate(currItem->rotation());
- }
- p->scale(scalex, scaley);
- currItem->DrawPolyL(p, currItem->Clip);
- p->restore();
+ if (currItem->isGroup())
+ {
+ p->save();
+ p->setBrush(m_brush["outline"]);
+ p->setPen(m_pen["outline"]);
+ p->translate(currItem->xPos(), currItem->yPos());
+ p->translate(deltax, deltay);
+ if (currItem->rotation() != 0)
+ {
+ p->setRenderHint(QPainter::Antialiasing);
+ p->rotate(currItem->rotation());
+ }
+ p->scale(scalex, scaley);
+ PageItem_Group* gItem = currItem->asGroupFrame();
+ uint itemCountG = gItem->groupItemList.count();
+ if (itemCountG < m_canvas->moveWithFullOutlinesThreshold)
+ {
+ for (uint cg = 0; cg < itemCountG; cg++)
+ {
+ p->save();
+ currItem = gItem->groupItemList.at(cg);
+ p->translate(currItem->gXpos, currItem->gYpos);
+ currItem->DrawPolyL(p, currItem->Clip);
+ p->restore();
+ }
+ }
+ else
+ {
+ currItem->DrawPolyL(p, currItem->Clip);
+ }
+ p->restore();
+ }
+ else
+ {
+ p->save();
+ p->setBrush(m_brush["outline"]);
+ p->setPen(m_pen["outline"]);
+ p->translate(currItem->xPos(), currItem->yPos());
+ p->translate(deltax, deltay);
+ if (currItem->rotation() != 0)
+ {
+ p->setRenderHint(QPainter::Antialiasing);
+ p->rotate(currItem->rotation());
+ }
+ p->scale(scalex, scaley);
+ currItem->DrawPolyL(p, currItem->Clip);
+ p->restore();
+ }
}
}
}
More information about the scribus-commit
mailing list