@@ -163,6 +163,7 @@ struct Widget::State {
163163 vrb::Matrix translation = vrb::Matrix::Translation (vrb::Vector (0 .0f , 0 .0f , radius * scale));
164164 cylinder->SetTransform (translation.PostMultiply (scaleMatrix));
165165 AdjustCylinderRotation (radius * scale);
166+ UpdateResizerTransform ();
166167 }
167168
168169 void AdjustCylinderRotation (const float radius) {
@@ -195,6 +196,12 @@ struct Widget::State {
195196 }
196197 borders.clear ();
197198 }
199+
200+ void UpdateResizerTransform () {
201+ if (resizer) {
202+ resizer->SetTransform (transformContainer->GetTransform ().PostMultiply (transform->GetTransform ()));
203+ }
204+ }
198205};
199206
200207WidgetPtr
@@ -347,6 +354,7 @@ Widget::SetTransform(const vrb::Matrix& aTransform) {
347354 if (m.cylinder ) {
348355 m.UpdateCylinderMatrix ();
349356 }
357+ m.UpdateResizerTransform ();
350358}
351359
352360void
@@ -443,7 +451,7 @@ Widget::SetPlacement(const WidgetPlacementPtr& aPlacement) {
443451 }
444452}
445453
446- void
454+ WidgetResizerPtr
447455Widget::StartResize (const vrb::Vector& aMaxSize, const vrb::Vector& aMinSize) {
448456 vrb::Vector worldMin, worldMax;
449457 GetWidgetMinAndMax (worldMin, worldMax);
@@ -452,11 +460,10 @@ Widget::StartResize(const vrb::Vector& aMaxSize, const vrb::Vector& aMinSize) {
452460 } else {
453461 vrb::RenderContextPtr render = m.context .lock ();
454462 if (!render) {
455- return ;
463+ return nullptr ;
456464 }
457465 vrb::CreationContextPtr create = render->GetRenderThreadCreationContext ();
458466 m.resizer = WidgetResizer::Create (create, this );
459- m.transform ->InsertNode (m.resizer ->GetRoot (), 0 );
460467 }
461468 m.resizer ->SetResizeLimits (aMaxSize, aMinSize);
462469 m.resizing = true ;
@@ -465,6 +472,8 @@ Widget::StartResize(const vrb::Vector& aMaxSize, const vrb::Vector& aMinSize) {
465472 m.quad ->SetScaleMode (Quad::ScaleMode::AspectFit);
466473 m.quad ->SetBackgroundColor (vrb::Color (1 .0f , 1 .0f , 1 .0f , 1 .0f ));
467474 }
475+ m.UpdateResizerTransform ();
476+ return m.resizer ;
468477}
469478
470479void
@@ -601,6 +610,7 @@ void Widget::LayoutQuadWithCylinderParent(const CylinderPtr& aCylinder) {
601610 } else {
602611 m.transformContainer ->SetTransform (vrb::Matrix::Identity ());
603612 }
613+ m.UpdateResizerTransform ();
604614}
605615
606616Widget::Widget (State& aState, vrb::RenderContextPtr& aContext) : m(aState) {
0 commit comments