r17018 by fschmid - Fixed Bug 10199: "Group displays bad" and other pathtext related fixes.

scribus-commit scribus-commit at lists.scribus.net
Thu Nov 24 13:21:49 UTC 2011


Author: fschmid
Date: Thu Nov 24 13:21:48 2011
New Revision: 17018

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17018
Log:
Fixed Bug 10199: "Group displays bad" and other pathtext related fixes.

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem_symbol.cpp
    trunk/Scribus/scribus/pdflib_core.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    trunk/Scribus/scribus/pslib.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/ui/propertiespalette_text.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17018&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Thu Nov 24 13:21:48 2011
@@ -5925,6 +5925,13 @@
 		FPoint maxAr = getMaxClipF(&arrow);
 		totalRect = totalRect.united(QRectF(QPointF(minAr.x(), minAr.y()), QPointF(maxAr.x(), maxAr.y())));
 	}
+	if (isPathText())
+	{
+		QTransform clipTrans;
+		clipTrans.translate(Xpos, Ypos);
+		clipTrans.rotate(Rot);
+		totalRect = totalRect.united(QRectF(clipTrans.mapRect(Clip.boundingRect())));
+	}
 	totalRect.getCoords(x1, y1, x2, y2);
 }
 
@@ -5956,6 +5963,8 @@
 				extraSpace = sl.Width / 2.0;
 		}
 	}
+	if (isPathText())
+		return qMin(Xpos + QRectF(Clip.boundingRect()).x(), Xpos - extraSpace);
 	return Xpos - extraSpace;
 }
 
@@ -5984,6 +5993,8 @@
 		if ((sl.Color != CommonStrings::None) && (sl.Width != 0))
 			extraSpace = sl.Width / 2.0;
 	}
+	if (isPathText())
+		return qMin(Ypos + QRectF(Clip.boundingRect()).y(), Ypos - extraSpace);
 	return Ypos - extraSpace;
 }
 
@@ -6015,6 +6026,8 @@
 				extraSpace = sl.Width;
 		}
 	}
+	if (isPathText())
+		return qMax(QRectF(Clip.boundingRect()).width(), Width + extraSpace);
 	return Width + extraSpace;
 }
 
@@ -6043,6 +6056,8 @@
 		if ((sl.Color != CommonStrings::None) && (sl.Width != 0))
 			extraSpace = sl.Width;
 	}
+	if (isPathText())
+		return qMax(QRectF(Clip.boundingRect()).height(), Height + extraSpace);
 	return isLine() ? extraSpace : Height + extraSpace;
 }
 

Modified: trunk/Scribus/scribus/pageitem_symbol.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17018&path=/trunk/Scribus/scribus/pageitem_symbol.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_symbol.cpp (original)
+++ trunk/Scribus/scribus/pageitem_symbol.cpp Thu Nov 24 13:21:48 2011
@@ -110,7 +110,7 @@
 			p->setMaskMode(0);
 			ScPattern pat = m_Doc->docPatterns[patternVal];
 			p->scale(Width / pat.width, Height / pat.height);
-			p->translate(pat.items.at(0)->gXpos, pat.items.at(0)->gYpos);
+	//		p->translate(pat.items.at(0)->gXpos, pat.items.at(0)->gYpos);
 			for (int em = 0; em < pat.items.count(); ++em)
 			{
 				PageItem* embedded = pat.items.at(em);

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17018&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Thu Nov 24 13:21:48 2011
@@ -2518,7 +2518,7 @@
 							QTransform trans;
 							trans.scale(ite->width() / pat.width, ite->height() / pat.height);
 							trans.translate(0.0, -ite->height());
-							trans.translate(pat.items.at(0)->gXpos, -pat.items.at(0)->gYpos);
+					//		trans.translate(pat.items.at(0)->gXpos, -pat.items.at(0)->gYpos);
 							PutPage(FToStr(trans.m11())+" "+FToStr(trans.m12())+" "+FToStr(trans.m21())+" "+FToStr(trans.m22())+" "+FToStr(trans.dx())+" "+FToStr(trans.dy())+" cm\n");
 							for (int em = 0; em < pat.items.count(); ++em)
 							{
@@ -4340,7 +4340,7 @@
 				QTransform trans;
 				trans.scale(ite->width() / pat.width, ite->height() / pat.height);
 				trans.translate(0.0, -ite->height());
-			//	trans.translate(pat.items.at(0)->gXpos, -pat.items.at(0)->gYpos);
+	//			trans.translate(pat.items.at(0)->gXpos, -pat.items.at(0)->gYpos);
 				tmp += FToStr(trans.m11())+" "+FToStr(trans.m12())+" "+FToStr(trans.m21())+" "+FToStr(trans.m22())+" "+FToStr(trans.dx())+" "+FToStr(trans.dy())+" cm\n";
 				for (int em = 0; em < pat.items.count(); ++em)
 				{

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17018&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Thu Nov 24 13:21:48 2011
@@ -2262,7 +2262,7 @@
 		docu.writeAttribute("DASHOFF", item->DashOffset);
 	}
 	if (!(item->isArc() || item->isSpiral() || item->isRegularPolygon()))
-		docu.writeAttribute("path", item->PoLine.svgPath(!item->isPolyLine()));
+		docu.writeAttribute("path", item->PoLine.svgPath(!(item->isPolyLine() || item->isPathText())));
 	QString colp = item->ContourLine.svgPath(true);
 	if (!colp.isEmpty())
 		docu.writeAttribute("copath", colp);

Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17018&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Thu Nov 24 13:21:48 2011
@@ -491,6 +491,7 @@
 		QBuffer b(&buf);
 		b.open( QIODevice::WriteOnly );
 		spoolStream.setDevice(&b);
+//		PS_translate(pa.items.at(0)->gXpos, -pa.items.at(0)->gYpos);
 		for (int em = 0; em < pa.items.count(); ++em)
 		{
 			PageItem* item = pa.items.at(em);
@@ -2613,7 +2614,7 @@
 				}
 				PS_scale(c->width() / pat.width, c->height() / pat.height);
 				PS_translate(0, -c->height());
-		//		PS_translate(pat.items.at(0)->gXpos, -pat.items.at(0)->gYpos);
+	//			PS_translate(pat.items.at(0)->gXpos, -pat.items.at(0)->gYpos);
 				for (int em = 0; em < pat.items.count(); ++em)
 				{
 					PageItem* embed = pat.items.at(em);

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17018&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Thu Nov 24 13:21:48 2011
@@ -9874,10 +9874,9 @@
 	double y = currItem->visualYPos();
 	double w = currItem->visualWidth();
 	double h = currItem->visualHeight();
-	currItem->setXYPos(0, 0, true);
-	currItem->moveBy(-currItem->visualXPos() / 2.0, -currItem->visualYPos() / 2.0);
-	currItem->gXpos = currItem->xPos();
-	currItem->gYpos = currItem->yPos();
+	currItem->gXpos = currItem->xPos() - x;
+	currItem->gYpos = currItem->yPos() - y;
+	currItem->setXYPos(currItem->gXpos, currItem->gYpos, true);
 	int d = doc->Items->indexOf(currItem);
 	z = doc->itemAdd(PageItem::Symbol, PageItem::Rectangle, x, y, w, h, 0, CommonStrings::None, CommonStrings::None, true);
 	PageItem* groupItem = doc->Items->takeAt(z);

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17018&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Thu Nov 24 13:21:48 2011
@@ -5601,8 +5601,7 @@
 		{
 			m_Selection->addItem(Items->at(as));
 		}
-		QRectF sR = m_Selection->getGroupRect();
-		moveGroup(-sR.x() + addedPage->xOffset(), -sR.y() + addedPage->yOffset());
+		moveGroup(addedPage->xOffset(), addedPage->yOffset());
 		if (Items->at(0)->isGroup())
 			Items->at(0)->asGroupFrame()->adjustXYPosition();
 		m_Selection->clear();
@@ -5675,10 +5674,9 @@
 		miny = qMin(miny, y1);
 		maxx = qMax(maxx, x2);
 		maxy = qMax(maxy, y2);
-		currItem->setXYPos(0, 0, true);
-		currItem->moveBy(-currItem->visualXPos() / 2.0, -currItem->visualYPos() / 2.0);
-		currItem->gXpos = currItem->xPos();
-		currItem->gYpos = currItem->yPos();
+		currItem->gXpos = currItem->xPos() - currItem->visualXPos();
+		currItem->gYpos = currItem->yPos() - currItem->visualYPos();
+		currItem->setXYPos(currItem->gXpos, currItem->gYpos, true);
 		docPatterns[currentEditedSymbol].pattern = currItem->DrawObj_toImage(qMax(maxx - minx, maxy - miny));
 		docPatterns[currentEditedSymbol].width = maxx - minx;
 		docPatterns[currentEditedSymbol].height = maxy - miny;

Modified: trunk/Scribus/scribus/ui/propertiespalette_text.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17018&path=/trunk/Scribus/scribus/ui/propertiespalette_text.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_text.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_text.cpp Thu Nov 24 13:21:48 2011
@@ -824,7 +824,7 @@
 {
 	if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 		return;
-	m_item->textPathType = pathTextType->currentIndex();
+	m_item->textPathType = pathTextWidgets->pathTextType->currentIndex();
 	m_item->update();
 	emit DocChanged();
 }




More information about the scribus-commit mailing list