Stupi / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
0 stars 0 forks source link

XHTMLPanel in a FSScrollPane and GTK look&feel rendering bug #150

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. a simple XHTMLPanel in a FSScrollPane, with the GTK look&feel

What is the expected output? What do you see instead?
Using the GTK LAF the rendering of the XHTMLPanel through a FSScrollPane is 
buggy.
The width of the rendered XHTMLPane is not equal to the width of the 
scrollpane's viewport view, although the text wrapping of the XHTMLPane should 
provide this equality (when it is possible considering the viewed html page, I 
know that).

Screenshot in attached file.

Thus the horizontal scrollbar of the FSScrollPane is always displayed, and few 
pixels of the XHTMLPanel are outside the scrollpane. 

When we change the size of the FFScrollPane the problem is still here: the size 
of XHTMLPane is computed, the size of the FSScrollPane is computed but the 
width of both are never equals.

What version of the product are you using? On what operating system?
Debian 6 SQUEEZE
jdk-6u24-linux-i586
flyingsaucer-R8

Please provide any additional information below.

Original issue reported on code.google.com by nicolas.james@gmail.com on 6 May 2011 at 3:00

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Hi, 

(Sorry for the last comments, I have deleted them. Do not take them in account. 
I posted before having a good enough overview of the rendering process of 
XHTMLPanel).

To fix for the LAF problem (I think it is OK, but as I said I just begin with 
Flyingsaucer), change the code of the method RootPanel.getScreenExtents() with 
the following:

public Rectangle getScreenExtents() {
        Rectangle extents;
        if (enclosingScrollPane != null) {
             Rectangle bnds = new Rectangle(enclosingScrollPane.getViewport().getSize());
            extents = new Rectangle(0, 0, bnds.width, bnds.height);
            //Uu.p("bnds = " + bnds);
        } else {
            extents = new Rectangle(getWidth(), getHeight());//200, 200 ) );
        }
        return extents;
    }

The source of the problem is that for the GTK LAF:
enclosingScrollPane.getViewport().getSize()
and
enclosingScrollPane.getViewportBorderBounds()
do not give the same dimension.

Original comment by nicolas.james@gmail.com on 8 May 2011 at 8:50