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

Viewed 147

I have a bit of an issue here..

I'm trying to have a svgpath be a background image by using it in a stackpane. I have a set-up like this:

beautiful layout

Where that grey triangle is a svgpath (just a basic one for testing purposes). Now that SVG is located inside an hbox like so:

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 this all works well and good, but I need to scale the svgpath down a bit..

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 the green box to adhere to the new, scaled-down bounds of the svgpath. Is there a way to "update" the width/height of the stackpane to the new bounds?

Thank you for any help!

0 Answers
Related