So, for my own education: width_ is the width of the row, counting the margins or not counting them?

Modifying a bit what we have so far, what's attached works well for me in most cases, though we still have the box being pushed off the right edge. I'm also troubled by the fact that we're treating the RTL case so differently, but I don't understand why it's so different in the first place, so I don't propose to even try to deal with that myself. Dov, do you know what to do here?

rh


Index: rowpainter.cpp
===================================================================
--- rowpainter.cpp	(revision 22701)
+++ rowpainter.cpp	(working copy)
@@ -610,10 +610,13 @@
 		FontMetrics const & fm = theFontMetrics(font);
 		int const size = int(0.75 * fm.maxAscent());
 		int const y = yo_ - size;
-		int x = is_rtl ? nestMargin() + changebarMargin() : width_ - size;
+		int const rightSide = is_rtl ? width_ :
+				width_ - text_metrics_.rightMargin(pm_) - 2;
+		int x = is_rtl ? nestMargin() + changebarMargin() : 
+				width_ - text_metrics_.rightMargin(pm_) - leftMargin() - size;
 
-		if (width_ - int(row_.width()) <= size)
-			x += (size - width_ + row_.width() + 1) * (is_rtl ? -1 : 1);
+		if (rightSide - row_.width() <= size)
+			x += (size - rightSide + row_.width() + 1) * (is_rtl ? -1 : 1);
 
 		if (endlabel == END_LABEL_BOX)
 			pi_.pain.rectangle(x, y, size, size, Color_eolmarker);

Reply via email to