Pivot
  1. Pivot
  2. PIVOT-803

ImageView placement is incorrect when nested inside two TablePanes

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.1
    • Component/s: wtk
    • Labels:
      None

      Description

      If you have an ImageView nested two levels deep inside a TablePane, the image is aligned incorrectly. I've seen cases that vary from no problem to the top coordinate being so large that the image doesn't display at all.

      I wrote about this a long time ago (http://apache-pivot-users.399431.n3.nabble.com/ImageView-messes-up-nested-inside-two-TablePanes-td2514398.html) but apparently neglected to file a bug report. At the time, Greg suggested that the layout code was passing the wrong height to the ImageView.

      I'll attach a test case.

      1. test.zip
        7 kB
        Bill van Melle

        Activity

        Bill van Melle created issue -
        Hide
        Bill van Melle added a comment -

        This is a TablePane with two columns. In the first column, I demonstrate the bug by placing a TablePane in the cell, and within that an ImageView. In the second column I place the same ImageView unnested, which displays correctly.

        Show
        Bill van Melle added a comment - This is a TablePane with two columns. In the first column, I demonstrate the bug by placing a TablePane in the cell, and within that an ImageView. In the second column I place the same ImageView unnested, which displays correctly.
        Bill van Melle made changes -
        Field Original Value New Value
        Attachment test.zip [ 12499599 ]
        Hide
        Bill van Melle added a comment -

        I traced thru the code to see that, as Greg observed, the inner TablePane is computing the height of its row to be larger than the constrained height of the TablePane itself.

        I should note that in my toy example, a workaround is to redundantly specify the height of the inner TablePane's first row to be the same as the height of the row the TablePane is in. But for more complex layouts (i.e., where the outer row doesn't have a set height), I don't think there's something quite so simple to fix it.

        Show
        Bill van Melle added a comment - I traced thru the code to see that, as Greg observed, the inner TablePane is computing the height of its row to be larger than the constrained height of the TablePane itself. I should note that in my toy example, a workaround is to redundantly specify the height of the inner TablePane's first row to be the same as the height of the row the TablePane is in. But for more complex layouts (i.e., where the outer row doesn't have a set height), I don't think there's something quite so simple to fix it.
        Hide
        Sandro Martini added a comment -

        >I don't think there's something quite so simple to fix it.
        Ok, so assigned to 2.1 ... but if someone finds a solution before, be free to reassign to a 2.0.x release.

        Show
        Sandro Martini added a comment - >I don't think there's something quite so simple to fix it. Ok, so assigned to 2.1 ... but if someone finds a solution before, be free to reassign to a 2.0.x release.
        Sandro Martini made changes -
        Fix Version/s 2.1 [ 12314825 ]
        Hide
        Noel Grandin added a comment -

        I've checked in a basic fix in rev 1186281
        The problem was that TablePane was not dealing with the case where it had insufficient space.
        This is a bit of a blunt solution, but at least it's simple.

        Bill, please test and see how it works for you.

        Show
        Noel Grandin added a comment - I've checked in a basic fix in rev 1186281 The problem was that TablePane was not dealing with the case where it had insufficient space. This is a bit of a blunt solution, but at least it's simple. Bill, please test and see how it works for you.
        Hide
        Sandro Martini added a comment -

        Reassigned, so maybe (after your commit) we can resolve even this in 2.0.1 .... let's wait Bill feedback.

        Show
        Sandro Martini added a comment - Reassigned, so maybe (after your commit) we can resolve even this in 2.0.1 .... let's wait Bill feedback.
        Sandro Martini made changes -
        Assignee Noel Grandin [ grandinj ]
        Fix Version/s 2.0.1 [ 12315951 ]
        Fix Version/s 2.1 [ 12314825 ]
        Affects Version/s 2.0.1 [ 12315951 ]
        Hide
        Sandro Martini added a comment -

        Just commited test case (here in attach), but as pivot_803 , in the same package as other tests.

        Noel when you want, resolve this issue ... to me looks good.

        Bye

        Show
        Sandro Martini added a comment - Just commited test case (here in attach), but as pivot_803 , in the same package as other tests. Noel when you want, resolve this issue ... to me looks good. Bye
        Noel Grandin made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Bill van Melle added a comment -

        Thanks for the quick fix, this seems to have fixed the problem for me. (Sorry for the delay in replying – I filed the ticket and then went on vacation.)

        Show
        Bill van Melle added a comment - Thanks for the quick fix, this seems to have fixed the problem for me. (Sorry for the delay in replying – I filed the ticket and then went on vacation.)

          People

          • Assignee:
            Noel Grandin
            Reporter:
            Bill van Melle
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development