Summary: | Text underline not long enough (testcase) | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Jim Dabell <jim> |
Component: | khtml | Assignee: | Konqueror Developers <konq-bugs> |
Status: | CLOSED FIXED | ||
Severity: | normal | CC: | bugzilla |
Priority: | NOR | ||
Version: | 3.1.1 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Testcase |
Description
Jim Dabell
2002-11-14 00:57:33 UTC
Created attachment 432 [details]
Testcase
Notice how the underline is slightly longer on the third link; as if the length
of text is still a factor (looks like the underline is cut in half).
Yes, bug shows in KDE_3_1_BRANCH from December 20. This problem also occurs when justified text is used. KHTML (or QT probably) seems to calculate the normal text width, but then stretches the text to fit exactly in the horizontal space, which results in whitespace between the words. However, this is not taken into consideration when the link underline width is calculated. Also: when you try to select text in a justified space that is stretched, you have to position the cursor somewhat (depends on amount of whitespace inserted) left of the text you want to select when starting the selection. I'm using KDE 3.1.1 by the way. This bug has been in KDE for some time now, but now I realise what the problem is. Probably a matter of taking the whitespace into consideration when calculating the X-size. I don't know exactly where this code is located though? See also bug 46224 and 55495. Another test case is <ins> <p style="text-align: justify">Some long text long text long text long text long text long text long text long text</p> </ins> *** This bug has been marked as a duplicate of 46224 *** 46224 has been fixed, but this still doesn't work. Reopening. *** Bug 62447 has been marked as a duplicate of this bug. *** Subject: kdelibs/khtml/rendering CVS commit by savernik: fixed bug 50683: Text underline not long enough (testcase) CCMAIL: 50683-done@bugs.kde.org M +3 -9 render_text.cpp 1.224 M +2 -2 render_text.h 1.97 --- kdelibs/khtml/rendering/render_text.cpp #1.223:1.224 @@ -219,5 +219,5 @@ void InlineTextBox::paintDecoration( QPa } #else -void InlineTextBox::paintDecoration( QPainter *pt, const Font *f, int _tx, int _ty, int deco, bool begin, bool end) +void InlineTextBox::paintDecoration( QPainter *pt, const Font *f, int _tx, int _ty, int deco) { _tx += m_x; @@ -227,10 +227,4 @@ void InlineTextBox::paintDecoration( QPa RenderObject *p = object(); - if( begin ) - width -= p->paddingLeft() + p->borderLeft(); - - if ( end ) - width -= p->paddingRight() + p->borderRight(); - QColor underline, overline, linethrough; p->getTextDecorationColors(deco, underline, overline, linethrough, p->style()->htmlHacks()); @@ -996,5 +990,5 @@ void RenderText::paintObject( QPainter * if(d != TDNONE) { - s->paintDecoration(p, font, tx, ty, d, si == 0, si == ( int ) m_lines.count()-1); + s->paintDecoration(p, font, tx, ty, d); } --- kdelibs/khtml/rendering/render_text.h #1.96:1.97 @@ -70,5 +70,5 @@ public: virtual bool isInlineTextBox() const { return true; } - void paintDecoration( QPainter *pt, const Font *f, int _tx, int _ty, int decoration, bool begin, bool end); + void paintDecoration( QPainter *pt, const Font *f, int _tx, int _ty, int decoration); void paintBoxDecorations(QPainter *p, RenderStyle* style, RenderText *parent, int _tx, int _ty, bool begin, bool end); void paintSelection(const Font *f, RenderText *text, QPainter *p, RenderStyle* style, int tx, int ty, int startPos, int endPos, int deco); |