r19128 by fschmid - Fixed Bug #12319: Wrong resizing/preview of more items selected
scribus-commit
scribus-commit at lists.scribus.net
Tue May 20 10:33:45 UTC 2014
Author: fschmid
Date: Tue May 20 10:33:44 2014
New Revision: 19128
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19128
Log:
Fixed Bug #12319: Wrong resizing/preview of more items selected
Modified:
trunk/Scribus/scribus/canvasgesture_resize.cpp
trunk/Scribus/scribus/canvasmode.cpp
trunk/Scribus/scribus/pageitem_arc.cpp
trunk/Scribus/scribus/scribusdoc.cpp
Modified: trunk/Scribus/scribus/canvasgesture_resize.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19128&path=/trunk/Scribus/scribus/canvasgesture_resize.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_resize.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_resize.cpp Tue May 20 10:33:44 2014
@@ -171,7 +171,7 @@
if (m_origBounds != m_bounds)
{
- if (m_doc->m_Selection->count() > 0)
+ if (m_doc->m_Selection->count() == 1)
{
p->setBrush(Qt::NoBrush);
QPen out = QPen(Qt::gray, 1.0 , Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
@@ -181,18 +181,48 @@
QTransform m;
m.translate(localRect.x(), localRect.y());
m.scale(localRect.width() / currItem->width(), localRect.height() / currItem->height());
- if (currItem->imageFlippedH())
+ if (!currItem->isSpiral())
{
- m.translate(currItem->width(), 0);
- m.scale(-1, 1);
- }
- if (currItem->imageFlippedV())
- {
- m.translate(0, currItem->height());
- m.scale(1, -1);
+ if (currItem->imageFlippedH())
+ {
+ m.translate(currItem->width(), 0);
+ m.scale(-1, 1);
+ }
+ if (currItem->imageFlippedV())
+ {
+ m.translate(0, currItem->height());
+ m.scale(1, -1);
+ }
}
QPolygon clip = m.map(currItem->Clip);
currItem->DrawPolyL(p, clip);
+ }
+ else if (m_doc->m_Selection->isMultipleSelection())
+ {
+ double x, y, w, h;
+ m_doc->m_Selection->setGroupRect();
+ m_doc->m_Selection->getGroupRect(&x, &y, &w, &h);
+ double scx = localRect.width() / w;
+ double scy = localRect.height() / h;
+ uint docSelectionCount = m_doc->m_Selection->count();
+ if (docSelectionCount < m_canvas->moveWithBoxesOnlyThreshold)
+ {
+ PageItem *currItem;
+ for (uint a = 0; a < docSelectionCount; ++a)
+ {
+ currItem = m_doc->m_Selection->itemAt(a);
+ if (!m_doc->Items->contains(currItem))
+ continue;
+ QTransform m;
+ m.translate(localRect.x(), localRect.y());
+ m.translate((currItem->xPos() - x) * scy, (currItem->yPos() - y) * scy);
+ m.scale(scx, scy);
+ if (currItem->rotation() != 0)
+ m.rotate(currItem->rotation());
+ QPolygon clip = m.map(currItem->Clip);
+ currItem->DrawPolyL(p, clip);
+ }
+ }
}
}
p->restore();
Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19128&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Tue May 20 10:33:44 2014
@@ -500,6 +500,16 @@
// m_scaleX *= -1;
}
p->translate(deltax, deltay);
+ if (currItem->imageFlippedH())
+ {
+ p->translate(currItem->width(), 0);
+ p->scale(-1.0, 1.0);
+ }
+ if (currItem->imageFlippedV())
+ {
+ p->translate(0, currItem->height());
+ p->scale(1.0, -1.0);
+ }
if (gRot != 0)
{
p->setRenderHint(QPainter::Antialiasing);
Modified: trunk/Scribus/scribus/pageitem_arc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19128&path=/trunk/Scribus/scribus/pageitem_arc.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_arc.cpp (original)
+++ trunk/Scribus/scribus/pageitem_arc.cpp Tue May 20 10:33:44 2014
@@ -73,6 +73,7 @@
path.closeSubpath();
PoLine.fromQPainterPath(path);
Clip = FlattenPath(PoLine, Segments);
+ setWidthHeight(arcWidth, arcHeight, true);
}
void PageItem_Arc::applicableActions(QStringList & actionList)
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19128&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Tue May 20 10:33:44 2014
@@ -14976,7 +14976,8 @@
FPoint n(gx-oldPos.x(), gy-oldPos.y());
x = ma3.m11() * n.x() + ma3.m21() * n.y() + ma3.dx();
y = ma3.m22() * n.y() + ma3.m12() * n.x() + ma3.dy();
- MoveItem(gx-x, gy-y, bb, true);
+ // MoveItem(gx-x, gy-y, bb, true);
+ bb->setXYPos(b1.x()+gx, b1.y()+gy);
if (oldRot != 0)
{
bb->setRotation(atan2(t1.y()-b1.y(),t1.x()-b1.x())*(180.0/M_PI));
@@ -15647,6 +15648,11 @@
PageItem_Arc* ite = item->asArc();
ite->arcWidth = ite->arcWidth * grScXi;
ite->arcHeight = ite->arcHeight * grScYi;
+ ite->recalcPath();
+ }
+ if (item->isSpiral())
+ {
+ PageItem_Spiral* ite = item->asSpiral();
ite->recalcPath();
}
if (item->asPathText())
More information about the scribus-commit
mailing list