r16726 by jghali - Port patch from Elvis Stansvik to 1.4.0svn : make frame overflow marker size constant when zooming in

scribus-commit scribus-commit at lists.scribus.net
Wed Jul 20 21:40:33 UTC 2011


Author: jghali
Date: Wed Jul 20 21:40:32 2011
New Revision: 16726

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16726
Log:
Port patch from Elvis Stansvik to 1.4.0svn : make frame overflow marker size constant when zooming in

Modified:
    branches/Version135/Scribus/scribus/pageitem_textframe.cpp

Modified: branches/Version135/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16726&path=/branches/Version135/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/pageitem_textframe.cpp (original)
+++ branches/Version135/Scribus/scribus/pageitem_textframe.cpp Wed Jul 20 21:40:32 2011
@@ -3500,50 +3500,33 @@
 
 void PageItem_TextFrame::drawOverflowMarker(ScPainter *p)
 {
-	/*CB Old large corner indicator.
-	double scp1 = 1.0/qMax(ScMW->view->getScale(), 1);
-	double scp16 = 16.0*scp1;
-	double scp14 = 14.0*scp1;
-	double scp3 = 3.0*scp1;
-	double scm_lineWidth16 = Width - scp16;
-	double scpheight16 = Height - scp16;
-	double scm_lineWidth3 = Width - scp3;
-	double scpheight3 = Height - scp3;
-	p->setPen(Qt::black, scp1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-	p->setBrush(white);
-	p->drawRect(scm_lineWidth16, scpheight16, scp14, scp14);
-	p->drawLine(FPoint(scm_lineWidth16, scpheight16), FPoint(scm_lineWidth3, scpheight3));
-	p->drawLine(FPoint(scm_lineWidth16, scpheight3), FPoint(scm_lineWidth3, scpheight16));
-	*/
 	//TODO: CB clean
 	ScribusView* view = m_Doc->view();
-	double scp1 = 1 ;// / ScMW->view->scale();
-	double ofwh = 8 * scp1;
-	//CB moved down while locked marker disabled
-	//double ofx = Width - ofwh/2;
-	//double ofy = Height - ofwh*3.0;
-	double ofx = Width - ofwh/2;
-	double ofy = Height - ofwh*1.5;
-	double lx1= ofx;
-	double ly1= ofy;
-	double lx2= ofx+ofwh;
-	double ly2= ofy+ofwh;
-	p->setPen(PrefsManager::instance()->appPrefs.DFrameNormColor, 0.5 / view->scale(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	
+	double sideLength = 10 / qMax(p->zoomFactor(), 1.0);
+	double left   = Width  - sideLength / 2;
+	double right  = left   + sideLength;
+	double top    = Height - sideLength * 1.5;
+	double bottom = top    + sideLength;
+
+	QColor color(PrefsManager::instance()->appPrefs.DFrameNormColor);
 	if ((isBookmark) || (m_isAnnotation))
-		p->setPen(PrefsManager::instance()->appPrefs.DFrameAnnotationColor, 0.5 / view->scale(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+		color = PrefsManager::instance()->appPrefs.DFrameAnnotationColor;
 	if ((BackBox != 0) || (NextBox != 0))
-		p->setPen(PrefsManager::instance()->appPrefs.DFrameLinkColor, 0.5 / view->scale(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+		color = PrefsManager::instance()->appPrefs.DFrameLinkColor;
 	if (m_Locked)
-		p->setPen(PrefsManager::instance()->appPrefs.DFrameLockColor, 0.5 / view->scale(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+		color = PrefsManager::instance()->appPrefs.DFrameLockColor;
 	if (m_Doc->m_Selection->containsItem(this))
-		p->setPen(Qt::red, 0.5 / view->scale(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+		color = Qt::red;
+
+	p->setPen(color, 0.5 / view->scale(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 	p->setPenOpacity(1.0);
 	p->setBrush(Qt::white);
 	p->setBrushOpacity(1.0);
 	p->setFillMode(ScPainter::Solid);
-	p->drawRect(ofx, ofy, ofwh, ofwh);
-	p->drawLine(FPoint(lx1, ly1), FPoint(lx2, ly2));
-	p->drawLine(FPoint(lx1, ly2), FPoint(lx2, ly1));
+	p->drawRect(left, top, sideLength, sideLength);
+	p->drawLine(FPoint(left, top), FPoint(right, bottom));
+	p->drawLine(FPoint(left, bottom), FPoint(right, top));
 }
 
 void PageItem_TextFrame::drawColumnBorders(ScPainter *p)




More information about the scribus-commit mailing list