+2008-12-08 Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+ * Line.cs: When calculating the text tags's Shift value, store it as
+ pixels instead of points. This way we can actually handle different
+ fonts in the same RichTextBox, as well as the right size of the caret.
+ Fixes part of #351938.
+
2008-12-08 Ivan N. Zlatev <contact@i-nz.net>
* DataGridViewCheckBoxCell.cs: Fix to make it work. Wrong value was
prev_ascent = this.ascent;\r
this.height = 0; // Reset line height\r
this.ascent = 0; // Reset the ascent for the line\r
- tag.Shift = 0;\r
+ tag.Shift = 0; // Reset shift (which should be stored as pixels, not as points)\r
\r
if (ending == LineEnding.Wrap)\r
widths[0] = document.left_margin + hanging_indent;\r
\r
while (tag.Length == 0) { // We should always have tags after a tag.length==0 unless len==0\r
//tag.Ascent = 0;\r
- tag.Shift = tag.Line.ascent - tag.Ascent;\r
+ tag.Shift = (tag.Line.ascent - tag.Ascent) / 72;\r
tag = tag.Next;\r
}\r
\r
// We have a tag that has a taller ascent than the line;\r
t = tags;\r
while (t != null && t != tag) {\r
- t.Shift = tag.Ascent - t.Ascent;\r
+ t.Shift = (tag.Ascent - t.Ascent) / 72;\r
t = t.Next;\r
}\r
\r
// Save on our line\r
this.ascent = tag.Ascent;\r
} else {\r
- tag.Shift = this.ascent - tag.Ascent;\r
+ tag.Shift = (this.ascent - tag.Ascent) / 72;\r
}\r
\r
tag = tag.Next;\r
}\r
\r
while (tag != null) { \r
- tag.Shift = tag.Line.ascent - tag.Ascent;\r
+ tag.Shift = (tag.Line.ascent - tag.Ascent) / 72;\r
tag = tag.Next;\r
}\r
\r