How to "update" the width / height of a node after scaling the SVG?

I have a bit of a problem here.

I am trying to create a svgpath

background image using it in stackpane

. I have a setup like this:

beautiful layout

Where this gray triangle is svgpath

(just a baseline for testing). Now that the SVG is inside hbox

, for example:

class mView : View() {
  override val root = vbox {
    label("test text") {
    //label styles
    }

    hbox {
      stackpane {
        //first blue box
      }

      stackpane {
        //second green box
        svgpath("M600 0 L350 800 L900 800 Z") {
          addClass(UIStyles.bgImagesStyle)
        }
      }

      stackpane {
        //third red box
      }
    }
  }
}

      

And it all works well and well, but I need to reduce it a bit svgpath

.

svgpath("M600 0 L350 800 L900 800 Z") {
  addClass(UIStyles.bgImagesStyle)
  scaleX = .4
  scaleY = .4
}

      

and then this happens:

enter image description here

I need a green border to snap to the new, reduced borders svgpath

. Is there a way to "update" the width / height of the stacking area to the new bounds?

Thanks for the help!

+3


source to share





All Articles