[patch] #55065: background image is limited to window-size
Germain Garand
germain at ebooksfrance.org
Thu Dec 4 15:45:14 GMT 2003
Le Jeudi 04 Décembre 2003 14:08, Dirk Mueller a écrit :
>> In the new implementation, positioned boxes can overflow the initial
>> containing block.
>
> but not the canvas.
oh yes, you are right, I explained poorly.
I say that because rh=canvas()->height() only
gets the viewport's height (see bottom of this message)
and is then QMaxed() with the root element's height:
render_box.ccp:218
h=height();
...
rh=canvas()->height();
...
int bh = QMAX(h + marginTop() + marginBottom() + borderTop() + borderBottom(),
rh);
...
paintBackground(.., .., .., .., bh);
So it was hard to decide which member of the QMAX was expected to be greater.
Currently, it's often the left hand side (i.e, the root element)
> I don't see why that patch makes a difference. actually I still think
> canvas()->height() is way more correct, unless its still 0 while this
> method is executed (unlikely).
It does make a difference because in RenderCanvas::layout(), the canvas'
dimensions are set to the *viewport* height/width, not to the content's
height/width:
m_view->resizeContents(docWidth(), docHeight());
// be optimistic and say that we never need a vertical
// scroll bar. fixes ugly cyclic recalculation chains
// with QScrollView.
QSize s = m_view->viewportSize(m_view->contentsWidth(),
0);
setWidth( m_viewportWidth = s.width() );
setHeight( m_viewportHeight = s.height() );
More information about the kfm-devel
mailing list