File tree Expand file tree Collapse file tree 11 files changed +65
-1
lines changed
Expand file tree Collapse file tree 11 files changed +65
-1
lines changed Original file line number Diff line number Diff line change @@ -1323,6 +1323,22 @@ void MCCard::toolchanged(Tool p_new_tool)
13231323 }
13241324}
13251325
1326+ void MCCard::OnViewTransformChanged ()
1327+ {
1328+ if (objptrs != nil)
1329+ {
1330+ MCObjptr *t_ptr = objptrs;
1331+ do
1332+ {
1333+ MCObject *t_obj = t_ptr->getref ();
1334+ if (t_obj != nil)
1335+ t_obj->OnViewTransformChanged ();
1336+ t_ptr = t_ptr->next ();
1337+ }
1338+ while (t_ptr != objptrs);
1339+ }
1340+ }
1341+
13261342void MCCard::OnAttach ()
13271343{
13281344 if (objptrs != NULL )
Original file line number Diff line number Diff line change @@ -100,6 +100,8 @@ class MCCard : public MCObject
100100 virtual void OnAttach ();
101101 virtual void OnDetach ();
102102
103+ virtual void OnViewTransformChanged ();
104+
103105 // MW-2011-09-20: [[ Collision ]] Compute shape of card.
104106 virtual bool lockshape (MCObjectShape& r_shape);
105107 virtual void unlockshape (MCObjectShape& shape);
Original file line number Diff line number Diff line change @@ -283,6 +283,22 @@ void MCGroup::toolchanged(Tool p_new_tool)
283283 }
284284}
285285
286+ void MCGroup::OnViewTransformChanged ()
287+ {
288+ MCControl::OnViewTransformChanged ();
289+ if (controls != nil)
290+ {
291+ MCControl *t_ctrl;
292+ t_ctrl = controls;
293+ do
294+ {
295+ t_ctrl->OnViewTransformChanged ();
296+ t_ctrl = t_ctrl->next ();
297+ }
298+ while (t_ctrl != controls);
299+ }
300+ }
301+
286302void MCGroup::OnAttach ()
287303{
288304 MCControl::OnAttach ();
Original file line number Diff line number Diff line change @@ -136,6 +136,8 @@ class MCGroup : public MCControl
136136 virtual void OnAttach ();
137137 virtual void OnDetach ();
138138
139+ virtual void OnViewTransformChanged ();
140+
139141 virtual void geometrychanged (const MCRectangle &p_rect);
140142
141143 virtual void viewportgeometrychanged (const MCRectangle &p_rect);
Original file line number Diff line number Diff line change @@ -85,6 +85,11 @@ bool MCNativeLayer::OnPaint(MCGContextRef p_context)
8585 return doPaint (p_context);
8686}
8787
88+ void MCNativeLayer::OnViewTransformChanged ()
89+ {
90+ doSetGeometry (m_rect);
91+ }
92+
8893void MCNativeLayer::OnGeometryChanged (const MCRectangle &p_new_rect)
8994{
9095 if (!m_defer_geometry_changes)
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ class MCNativeLayer
2929 virtual void OnDetach ();
3030 virtual bool OnPaint (MCGContextRef p_context);
3131 virtual void OnGeometryChanged (const MCRectangle& p_new_rect);
32+ virtual void OnViewTransformChanged ();
3233 virtual void OnViewportGeometryChanged (const MCRectangle &p_rect);
3334 virtual void OnVisibilityChanged (bool p_visible);
3435 virtual void OnToolChanged (Tool p_new_tool);
Original file line number Diff line number Diff line change @@ -1232,6 +1232,12 @@ void MCObject::viewportgeometrychanged(const MCRectangle &p_rect)
12321232 getNativeLayer ()->OnViewportGeometryChanged (p_rect);
12331233}
12341234
1235+ void MCObject::OnViewTransformChanged ()
1236+ {
1237+ if (getNativeLayer () != nil)
1238+ getNativeLayer ()->OnViewTransformChanged ();
1239+ }
1240+
12351241void MCObject::OnOpen ()
12361242{
12371243 if (getNativeLayer () != nil)
Original file line number Diff line number Diff line change @@ -629,6 +629,9 @@ class MCObject : public MCDLlist
629629 // IM-2016-01-19: [[ NativeWidgets ]] Informs the object that its visible area has changed.
630630 virtual void viewportgeometrychanged (const MCRectangle &p_rect);
631631
632+ // IM-2016-09-20: [[ Bug 16965 ]] Inform the object that the stack view transform has changed.
633+ virtual void OnViewTransformChanged ();
634+
632635 // IM-2015-12-16: [[ NativeWidgets ]] Informs the object that it has been opened.
633636 virtual void OnOpen ();
634637 // IM-2015-12-16: [[ NativeWidgets ]] Informs the object that it will be closed.
Original file line number Diff line number Diff line change @@ -1572,6 +1572,12 @@ void MCStack::toolchanged(Tool p_new_tool)
15721572 curcard->toolchanged (p_new_tool);
15731573}
15741574
1575+ void MCStack::OnViewTransformChanged ()
1576+ {
1577+ if (curcard != nil)
1578+ curcard->OnViewTransformChanged ();
1579+ }
1580+
15751581void MCStack::OnAttach ()
15761582{
15771583 if (curcard != nil)
Original file line number Diff line number Diff line change @@ -361,6 +361,8 @@ class MCStack : public MCObject
361361
362362 virtual void toolchanged (Tool p_new_tool);
363363
364+ virtual void OnViewTransformChanged ();
365+
364366 virtual void OnAttach ();
365367 virtual void OnDetach ();
366368
You can’t perform that action at this time.
0 commit comments