[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: kde-devel Digest, Vol 8, Issue 99
From:       James Ots <kde () jamesots ! com>
Date:       2003-11-26 12:47:31
[Download RAW message or body]

On Tuesday 25 Nov 2003 6:39 pm, Stephan Kulow wrote:
> On Tuesday 25 November 2003 16:41, James Ots wrote:
> > It's bug 44092. I've already submitted a dodgy patch for it, but no-one's
> > checked it out yet.
>
> Your patch makes at least the test case for
> http://bugs.kde.org/show_bug.cgi?id=68394 worse

Okay, here's a better one.

I'm not sure about a couple of things though:
1. Whether I need to add the padding and border to m_minWidth as well as 
m_maxWidth
2. Whether the fix needs to go in both the APPLE_CHANGES code and the non 
APPLE_CHANGES code.

-- 
Cheers
James Ots
www.jamesots.com

["patch" (text/x-diff)]

Index: rendering/render_text.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/rendering/render_text.cpp,v
retrieving revision 1.233
diff -u -3 -p -r1.233 render_text.cpp
--- rendering/render_text.cpp	22 Nov 2003 10:14:20 -0000	1.233
+++ rendering/render_text.cpp	26 Nov 2003 12:27:31 -0000
@@ -218,18 +218,22 @@ void InlineTextBox::paintDecoration( QPa
     QColor underline, overline, linethrough;
     object()->getTextDecorationColors(deco, underline, overline, linethrough, true);
 
+	int width = m_width;
+	width -= p->paddingLeft() + p->borderLeft();
+	width -= p->paddingRight() + p->borderRight();
+
     // Use a special function for underlines to get the positioning exactly right.
     if (deco & UNDERLINE) {
         pt->setPen(underline);
-        pt->drawLineForText(_tx, _ty, m_baseline, m_width);
+        pt->drawLineForText(_tx, _ty, m_baseline, width);
     }
     if (deco & OVERLINE) {
         pt->setPen(overline);
-        pt->drawLineForText(_tx, _ty, 0, m_width);
+        pt->drawLineForText(_tx, _ty, 0, width);
     }
     if (deco & LINE_THROUGH) {
         pt->setPen(linethrough);
-        pt->drawLineForText(_tx, _ty, 2*m_baseline/3, m_width);
+        pt->drawLineForText(_tx, _ty, 2*m_baseline/3, width);
     }
 }
 #else
@@ -244,6 +248,9 @@ void InlineTextBox::paintDecoration( QPa
     QColor underline, overline, linethrough;
     p->getTextDecorationColors(deco, underline, overline, linethrough, \
p->style()->htmlHacks());  
+	width -= p->paddingLeft() + p->borderLeft();
+	width -= p->paddingRight() + p->borderRight();
+
     if(deco & UNDERLINE){
         pt->setPen(underline);
         f->drawDecoration(pt, _tx, _ty, baseline(), width, height(), \
Font::UNDERLINE); @@ -1184,6 +1190,9 @@ void RenderText::calcMinMaxWidth()
     if (style()->whiteSpace() == NOWRAP)
         m_minWidth = m_maxWidth;
 
+	m_maxWidth += borderRight() + paddingRight() + borderLeft() + paddingLeft();
+	m_minWidth += borderRight() + paddingRight() + borderLeft() + paddingLeft();
+		
     setMinMaxKnown();
     //kdDebug( 6040 ) << "Text::calcMinMaxWidth(): min = " << m_minWidth << " max = \
" << m_maxWidth << endl;  



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic