Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Strange anomaly when positioning a 3rd level nested canvas

    I'm in the process of upgrading our software from using SmartClient version 11.0 to 12.0 and I have encountered some strange layout problems with 12.
    I managed to reduce the problem down to this simple example where I have a canvas with a dynamic height and snapTo B nested inside 2 levels of canvas controls.
    In that case, the middle canvas which has a FIXED size of 100 x 100 gets 'stretched' to 100 x 117 as if the most inner canvas is positioned without consideration of it's actual height and so it forces the middle canvas to stretch (because of overflow: "visible").

    Here is my sample code:
    You will notice that the blue canvas remains at 100x100 while the red one becomes 100x117 although they are created in exactly the same way - the only difference between them is that the red one is nested inside another canvas.

    Code:
    isc.Canvas.create({
        backgroundColor: "blue",
        width: 100,
        height: 100,
        children: [
            isc.Canvas.create({
                snapTo: "B",
                height: 1,
                overflow: "visible",
                contents: "Test",
                textColor: "white",
                backgroundColor: "black"
            })
        ]
    });
    
    isc.Canvas.create({
        top: 150,
        children: [
            isc.Canvas.create({
                backgroundColor: "red",
                width: 100,
                height: 100,
                children: [
                    isc.Canvas.create({
                        snapTo: "B",
                        height: 1,
                        overflow: "visible",
                        contents: "Test",
                        textColor: "white",
                        backgroundColor: "gray"
                    })
                ]
            })]
    });
    Note: If I run the same code on SC ver. 11.0 both the blue and the red canvases will be correctly sized to 100 x 100 and the inner canvas is positioned correctly inside them.
    Would love to hear your thoughts about this.

    Thanks in advance
    Gil

    #2
    Hi all,

    I tested out of interst here and can see the 117px height also with v11.1p_2019-11-08.

    Best regards
    Blama

    Comment


      #3
      We're able to reproduce this and are investigating.

      Comment


        #4
        This should be fixed back to SC 11.1p in the nightly builds dated 2019-11-17 and beyond.

        Comment


          #5
          Hi Isomorphic,

          I can see it fixed in v11.1p_2019-11-18, v12.0p_2019-11-17 and SNAPSHOT_v12.1d_2019-11-17.

          In 12.0/12.1 the font box is 100 x 18, while in 11.1 it is 100 x 17. Don't know if this is important or even on purpose.

          Best regards
          Blama

          Comment

          Working...
          X