r17796 by fschmid - #11112 "Still some blurred frame borders" fixed some of the issues mentioned there.

scribus-commit scribus-commit at lists.scribus.net
Wed Oct 10 21:34:10 UTC 2012


Author: fschmid
Date: Wed Oct 10 21:34:10 2012
New Revision: 17796

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17796
Log:
#11112 "Still some blurred frame borders" fixed some of the issues mentioned there.

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem_textframe.cpp
    trunk/Scribus/scribus/scribusview.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17796&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Wed Oct 10 21:34:10 2012
@@ -1956,7 +1956,7 @@
 		double scpInv = 0;
 		if (!isGroup())
 		{
-			if ((Frame) && (m_Doc->guidesPrefs().framesShown) && ((itemType() == ImageFrame) || (itemType() == LatexFrame) || (itemType() == OSGFrame) || (itemType() == PathText)))
+			if ((Frame) && (m_Doc->guidesPrefs().framesShown) && ((itemType() == ImageFrame) || (itemType() == LatexFrame) || (itemType() == OSGFrame) || (itemType() == PathText)) && (no_stroke))
 			{
 				p->setPen(PrefsManager::instance()->appPrefs.displayPrefs.frameNormColor, scpInv, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 				if ((isBookmark) || (m_isAnnotation))

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17796&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Wed Oct 10 21:34:10 2012
@@ -3484,7 +3484,10 @@
 								p->setStrokeMode(ScPainter::Solid);
 							}
 							else
+							{
+								no_stroke = true;
 								p->setStrokeMode(ScPainter::None);
+							}
 						}
 						else
 						{
@@ -3505,6 +3508,8 @@
 							p->setDash(DashValues, DashOffset);
 						p->strokePath();
 					}
+					else
+						no_stroke = true;
 				}
 				else
 				{
@@ -3547,7 +3552,7 @@
 	if ((!isEmbedded) && (!m_Doc->RePos))
 	{
 		double scpInv = 0.0;
-		if ((Frame) && (m_Doc->guidesPrefs().framesShown))
+		if ((Frame) && (m_Doc->guidesPrefs().framesShown) && (no_stroke))
 		{
 			p->setPen(PrefsManager::instance()->appPrefs.displayPrefs.frameNormColor, scpInv, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 			if ((isBookmark) || (m_isAnnotation))
@@ -3597,6 +3602,16 @@
 			double ofx = Width - ofwh/2;
 			double ofy = Height - ofwh*3;
 			p->drawSharpRect(ofx, ofy, ofwh, ofwh);
+		}
+		if (no_fill && no_stroke && m_Doc->guidesPrefs().framesShown)
+		{
+			p->setPen(PrefsManager::instance()->appPrefs.displayPrefs.frameNormColor, scpInv, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+			if (m_Locked)
+				p->setPen(PrefsManager::instance()->appPrefs.displayPrefs.frameLockColor, scpInv, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+			p->setFillMode(ScPainter::None);
+			p->drawSharpRect(0, 0, Width, Height);
+			no_fill = false;
+			no_stroke = false;
 		}
 		//if (m_Doc->selection->findItem(this)!=-1)
 		//	drawLockedMarker(p);

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17796&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Wed Oct 10 21:34:10 2012
@@ -24,6 +24,7 @@
 #include "scribusview.h"
 
 #include "scconfig.h"
+#include "sclimits.h"
 
 #include <QColor>
 #include <QDebug>
@@ -4028,16 +4029,19 @@
 			}
 			if (currItem->asTextFrame())
 			{
-				PageItem* newItem = new PageItem_Polygon(*currItem);
-				newItem->convertTo(PageItem::Polygon);
-				newItem->Frame = false;
-				newItem->ClipEdited = true;
-				newItem->FrameType = 3;
-				newItem->OldB2 = newItem->width();
-				newItem->OldH2 = newItem->height();
-				newItem->Clip = FlattenPath(newItem->PoLine, newItem->Segments);
-				newItem->ContourLine = newItem->PoLine.copy();
-				newGroupedItems.prepend(newItem);
+				if ((!currItem->NamedLStyle.isEmpty()) || (currItem->lineColor() != CommonStrings::None) || (!currItem->strokePattern().isEmpty()) || (!currItem->strokeGradient().isEmpty()))
+				{
+					PageItem* newItem = new PageItem_Polygon(*currItem);
+					newItem->convertTo(PageItem::Polygon);
+					newItem->Frame = false;
+					newItem->ClipEdited = true;
+					newItem->FrameType = 3;
+					newItem->OldB2 = newItem->width();
+					newItem->OldH2 = newItem->height();
+					newItem->Clip = FlattenPath(newItem->PoLine, newItem->Segments);
+					newItem->ContourLine = newItem->PoLine.copy();
+					newGroupedItems.prepend(newItem);
+				}
 			}
 			delItems.append(tmpSelection.takeItem(offset));
 		}
@@ -4051,7 +4055,24 @@
 		}
 		if (newGroupedItems.count() > 1)
 		{
-			int z = Doc->itemAdd(PageItem::Group, PageItem::Rectangle, currItem->xPos(), currItem->yPos(), currItem->width(), currItem->height(), 0, CommonStrings::None, CommonStrings::None, true);
+			double minx =  std::numeric_limits<double>::max();
+			double miny =  std::numeric_limits<double>::max();
+			double maxx = -std::numeric_limits<double>::max();
+			double maxy = -std::numeric_limits<double>::max();
+			for (uint ep = 0; ep < newGroupedItems.count(); ++ep)
+			{
+				double x1, x2, y1, y2;
+				newGroupedItems.at(ep)->getVisualBoundingRect(&x1, &y1, &x2, &y2);
+				minx = qMin(minx, x1);
+				miny = qMin(miny, y1);
+				maxx = qMax(maxx, x2);
+				maxy = qMax(maxy, y2);
+			}
+			double gx = minx;
+			double gy = miny;
+			double gw = maxx - minx;
+			double gh = maxy - miny;
+			int z = Doc->itemAdd(PageItem::Group, PageItem::Rectangle, gx, gy, gw, gh, 0, CommonStrings::None, CommonStrings::None, true);
 			PageItem *gItem = Doc->Items->takeAt(z);
 			Doc->groupObjectsToItem(gItem, newGroupedItems);
 			gItem->Parent = currItem->Parent;
@@ -4078,8 +4099,9 @@
 				tmpSelection.addItem(delItems.takeAt(0)); //yes, 0, remove the first
 			Doc->itemSelection_DeleteItem(&tmpSelection);
 		}
-		Doc->m_Selection->copy(tmpSelection, true);
+//		Doc->m_Selection->copy(tmpSelection, true);
 		m_ScMW->HaveNewSel(-1);
+		Deselect(true);
 		trans.commit();
 	}
 #endif




More information about the scribus-commit mailing list