r21193 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Thu Apr 14 16:27:52 UTC 2016


Author: jghali
Date: Thu Apr 14 16:27:52 2016
New Revision: 21193

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21193
Log:
#13881: First line text selection is inaccurate if "Align to Baseline Grid" is enabled
#13948: It's hard to select text, if "Space Above" is increased

Modified:
    trunk/Scribus/scribus/text/boxes.cpp

Modified: trunk/Scribus/scribus/text/boxes.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21193&path=/trunk/Scribus/scribus/text/boxes.cpp
==============================================================================
--- trunk/Scribus/scribus/text/boxes.cpp	(original)
+++ trunk/Scribus/scribus/text/boxes.cpp	Thu Apr 14 16:27:52 2016
@@ -120,7 +120,19 @@
 
 int LineBox::pointToPosition(QPointF coord) const
 {
-	int position = GroupBox::pointToPosition(coord);
+	int position = -1;
+
+	QPointF rel = coord - QPointF(m_x, m_y);
+	foreach (const Box *box, boxes())
+	{
+		int result = box->pointToPosition(rel);
+		if (result >= 0)
+		{
+			position = result;
+			break;
+		}
+	}
+
 	if (position < 0)
 	{
 		if (containsPoint(coord))
@@ -622,7 +634,8 @@
 	const QList<GlyphLayout>& glyphs = m_glyphRun.glyphs();
 	for (int i = 0; i < glyphs.length(); ++i)
 	{
-		double width = glyphs.at(i).xadvance;
+		const GlyphLayout& glyph = glyphs.at(i);
+		double width = glyph.xadvance * glyph.scaleH;
 		xPos += width;
 		if (xPos >= relX)
 		{




More information about the scribus-commit mailing list