jeff
12/21/2020, 11:02 PMContainer
be given an anchor? Or is there an alternative that can?
I have two views that I want to scale up and down together. I put them in a container thinking I could just change the container's `scale`but doing so makes them move as they scale, since they're using the parent container's "anchor" which is just the grandparent's origin. Thoughts?
(apologies for all the questions, and thanks to everyone who's been responding!)Mayank
12/22/2020, 5:49 PMcontainer {
val rect = solidRect(100, 100, Colors.RED) {
position(150, 150)
center()
}
val circle = circle(64.0, Colors.BLUE) {
position(250, 250)
center()
}
val qView = QView(listOf(rect, circle))
launchAnimate(looped = true, time = 2.seconds) {
tween(qView::scale[2.0], time = time)
tween(qView::scale[1.0], time = time)
}
}
val radius = 4.0
val rectCenter = circle(radius, Colors.GREEN).position(150.0 - radius, 150.0 - radius)
val circleCenter = circle(radius, Colors.GREEN).position(250.0 - radius, 250.0 - radius)
jeff
12/22/2020, 9:49 PMContainer
. But it also intrigued me about QView, which I don't see in the documentation anywhere. Looking at the impl it seems to be just a list of views that you can manipulate together? Cool!Mayank
12/23/2020, 11:55 AM