r18638 by fschmid - Fixed the resizeGroupToContens function to work correctly with rotated groups.
scribus-commit
scribus-commit at lists.scribus.net
Tue Dec 10 23:38:18 UTC 2013
Author: fschmid
Date: Tue Dec 10 23:38:18 2013
New Revision: 18638
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18638
Log:
Fixed the resizeGroupToContens function to work correctly with rotated groups.
Additional Fix: respect scaling of the group.
Modified:
trunk/Scribus/scribus/scribusdoc.cpp
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18638&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Tue Dec 10 23:38:18 2013
@@ -15408,6 +15408,8 @@
double oldX = currItem->xPos();
double oldY = currItem->yPos();
int gcount = currItem->groupItemList.count();
+ double scw = currItem->width() / currItem->groupWidth;
+ double sch = currItem->height() / currItem->groupHeight;
for (int c = 0; c < gcount; c++)
{
PageItem* gItem = currItem->groupItemList.at(c);
@@ -15420,16 +15422,17 @@
maxy = qMax(maxy, y2);
}
QTransform groupTrans = group->getTransform();
+ groupTrans.scale(scw, sch);
QPointF newXY = groupTrans.map(QPointF(minx - oldX, miny - oldY));
currItem->setXYPos(minx, miny, true);
- currItem->setWidthHeight(maxx - minx, maxy - miny, true);
+ currItem->setWidthHeight((maxx - minx) * scw, (maxy - miny) * sch, true);
currItem->groupWidth = maxx - minx;
currItem->groupHeight = maxy - miny;
for (int c = 0; c < gcount; c++)
{
PageItem* gItem = currItem->groupItemList.at(c);
- gItem->gXpos = gItem->xPos() - currItem->xPos();
- gItem->gYpos = gItem->yPos() - currItem->yPos();
+ gItem->gXpos = (gItem->xPos() - currItem->xPos());
+ gItem->gYpos = (gItem->yPos() - currItem->yPos());
gItem->gWidth = maxx - minx;
gItem->gHeight = maxy - miny;
}
More information about the scribus-commit
mailing list