UiLayoutCellComponent.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "UiLayoutCellComponent.h"
  9. #include <AzCore/Serialization/SerializeContext.h>
  10. #include <AzCore/Serialization/EditContext.h>
  11. #include <AzCore/RTTI/BehaviorContext.h>
  12. #include <LyShine/Bus/UiElementBus.h>
  13. #include <LyShine/Bus/UiLayoutManagerBus.h>
  14. ////////////////////////////////////////////////////////////////////////////////////////////////////
  15. // PUBLIC MEMBER FUNCTIONS
  16. ////////////////////////////////////////////////////////////////////////////////////////////////////
  17. ////////////////////////////////////////////////////////////////////////////////////////////////////
  18. UiLayoutCellComponent::UiLayoutCellComponent()
  19. : m_minWidthOverridden(false)
  20. , m_minWidth(0.0f)
  21. , m_minHeightOverridden(false)
  22. , m_minHeight(0.0f)
  23. , m_targetWidthOverridden(false)
  24. , m_targetWidth(0.0f)
  25. , m_targetHeightOverridden(false)
  26. , m_targetHeight(0.0f)
  27. , m_maxWidthOverridden(false)
  28. , m_maxWidth(0.0f)
  29. , m_maxHeightOverridden(false)
  30. , m_maxHeight(0.0f)
  31. , m_extraWidthRatioOverridden(false)
  32. , m_extraWidthRatio(0.0f)
  33. , m_extraHeightRatioOverridden(false)
  34. , m_extraHeightRatio(0.0f)
  35. {
  36. }
  37. ////////////////////////////////////////////////////////////////////////////////////////////////////
  38. UiLayoutCellComponent::~UiLayoutCellComponent()
  39. {
  40. }
  41. ////////////////////////////////////////////////////////////////////////////////////////////////////
  42. float UiLayoutCellComponent::GetMinWidth()
  43. {
  44. return m_minWidthOverridden ? m_minWidth : LyShine::UiLayoutCellUnspecifiedSize;
  45. }
  46. ////////////////////////////////////////////////////////////////////////////////////////////////////
  47. void UiLayoutCellComponent::SetMinWidth(float width)
  48. {
  49. if (LyShine::IsUiLayoutCellSizeSpecified(width))
  50. {
  51. m_minWidth = width;
  52. m_minWidthOverridden = true;
  53. }
  54. else
  55. {
  56. m_minWidth = LyShine::UiLayoutCellUnspecifiedSize;
  57. m_minWidthOverridden = false;
  58. }
  59. InvalidateLayout();
  60. }
  61. ////////////////////////////////////////////////////////////////////////////////////////////////////
  62. float UiLayoutCellComponent::GetMinHeight()
  63. {
  64. return m_minHeightOverridden ? m_minHeight : LyShine::UiLayoutCellUnspecifiedSize;
  65. }
  66. ////////////////////////////////////////////////////////////////////////////////////////////////////
  67. void UiLayoutCellComponent::SetMinHeight(float height)
  68. {
  69. if (LyShine::IsUiLayoutCellSizeSpecified(height))
  70. {
  71. m_minHeight = height;
  72. m_minHeightOverridden = true;
  73. }
  74. else
  75. {
  76. m_minHeight = LyShine::UiLayoutCellUnspecifiedSize;
  77. m_minHeightOverridden = false;
  78. }
  79. InvalidateLayout();
  80. }
  81. ////////////////////////////////////////////////////////////////////////////////////////////////////
  82. float UiLayoutCellComponent::GetTargetWidth()
  83. {
  84. return m_targetWidthOverridden ? m_targetWidth : LyShine::UiLayoutCellUnspecifiedSize;
  85. }
  86. ////////////////////////////////////////////////////////////////////////////////////////////////////
  87. void UiLayoutCellComponent::SetTargetWidth(float width)
  88. {
  89. if (LyShine::IsUiLayoutCellSizeSpecified(width))
  90. {
  91. m_targetWidth = width;
  92. m_targetWidthOverridden = true;
  93. }
  94. else
  95. {
  96. m_targetWidth = LyShine::UiLayoutCellUnspecifiedSize;
  97. m_targetWidthOverridden = false;
  98. }
  99. InvalidateLayout();
  100. }
  101. ////////////////////////////////////////////////////////////////////////////////////////////////////
  102. float UiLayoutCellComponent::GetTargetHeight()
  103. {
  104. return m_targetHeightOverridden ? m_targetHeight : LyShine::UiLayoutCellUnspecifiedSize;
  105. }
  106. ////////////////////////////////////////////////////////////////////////////////////////////////////
  107. void UiLayoutCellComponent::SetTargetHeight(float height)
  108. {
  109. if (LyShine::IsUiLayoutCellSizeSpecified(height))
  110. {
  111. m_targetHeight = height;
  112. m_targetHeightOverridden = true;
  113. }
  114. else
  115. {
  116. m_targetHeight = LyShine::UiLayoutCellUnspecifiedSize;
  117. m_targetHeightOverridden = false;
  118. }
  119. InvalidateLayout();
  120. }
  121. ////////////////////////////////////////////////////////////////////////////////////////////////////
  122. float UiLayoutCellComponent::GetMaxWidth()
  123. {
  124. return m_maxWidthOverridden ? m_maxWidth : LyShine::UiLayoutCellUnspecifiedSize;
  125. }
  126. ////////////////////////////////////////////////////////////////////////////////////////////////////
  127. void UiLayoutCellComponent::SetMaxWidth(float width)
  128. {
  129. if (LyShine::IsUiLayoutCellSizeSpecified(width))
  130. {
  131. m_maxWidth = width;
  132. m_maxWidthOverridden = true;
  133. }
  134. else
  135. {
  136. m_maxWidth = LyShine::UiLayoutCellUnspecifiedSize;
  137. m_maxWidthOverridden = false;
  138. }
  139. InvalidateLayout();
  140. }
  141. ////////////////////////////////////////////////////////////////////////////////////////////////////
  142. float UiLayoutCellComponent::GetMaxHeight()
  143. {
  144. return m_maxHeightOverridden ? m_maxHeight : LyShine::UiLayoutCellUnspecifiedSize;
  145. }
  146. ////////////////////////////////////////////////////////////////////////////////////////////////////
  147. void UiLayoutCellComponent::SetMaxHeight(float height)
  148. {
  149. if (LyShine::IsUiLayoutCellSizeSpecified(height))
  150. {
  151. m_maxHeight = height;
  152. m_maxHeightOverridden = true;
  153. }
  154. else
  155. {
  156. m_maxHeight = LyShine::UiLayoutCellUnspecifiedSize;
  157. m_maxHeightOverridden = false;
  158. }
  159. InvalidateLayout();
  160. }
  161. ////////////////////////////////////////////////////////////////////////////////////////////////////
  162. float UiLayoutCellComponent::GetExtraWidthRatio()
  163. {
  164. return m_extraWidthRatioOverridden ? m_extraWidthRatio : LyShine::UiLayoutCellUnspecifiedSize;
  165. }
  166. ////////////////////////////////////////////////////////////////////////////////////////////////////
  167. void UiLayoutCellComponent::SetExtraWidthRatio(float width)
  168. {
  169. if (LyShine::IsUiLayoutCellSizeSpecified(width))
  170. {
  171. m_extraWidthRatio = width;
  172. m_extraWidthRatioOverridden = true;
  173. }
  174. else
  175. {
  176. m_extraWidthRatio = LyShine::UiLayoutCellUnspecifiedSize;
  177. m_extraWidthRatioOverridden = false;
  178. }
  179. InvalidateLayout();
  180. }
  181. ////////////////////////////////////////////////////////////////////////////////////////////////////
  182. float UiLayoutCellComponent::GetExtraHeightRatio()
  183. {
  184. return m_extraHeightRatioOverridden ? m_extraHeightRatio : LyShine::UiLayoutCellUnspecifiedSize;
  185. }
  186. ////////////////////////////////////////////////////////////////////////////////////////////////////
  187. void UiLayoutCellComponent::SetExtraHeightRatio(float height)
  188. {
  189. if (LyShine::IsUiLayoutCellSizeSpecified(height))
  190. {
  191. m_extraHeightRatio = height;
  192. m_extraHeightRatioOverridden = true;
  193. }
  194. else
  195. {
  196. m_extraHeightRatio = LyShine::UiLayoutCellUnspecifiedSize;
  197. m_extraHeightRatioOverridden = false;
  198. }
  199. InvalidateLayout();
  200. }
  201. ////////////////////////////////////////////////////////////////////////////////////////////////////
  202. // PUBLIC STATIC MEMBER FUNCTIONS
  203. ////////////////////////////////////////////////////////////////////////////////////////////////////
  204. void UiLayoutCellComponent::Reflect(AZ::ReflectContext* context)
  205. {
  206. AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
  207. if (serializeContext)
  208. {
  209. serializeContext->Class<UiLayoutCellComponent, AZ::Component>()
  210. ->Version(1)
  211. ->Field("MinWidthOverridden", &UiLayoutCellComponent::m_minWidthOverridden)
  212. ->Field("MinWidth", &UiLayoutCellComponent::m_minWidth)
  213. ->Field("MinHeightOverridden", &UiLayoutCellComponent::m_minHeightOverridden)
  214. ->Field("MinHeight", &UiLayoutCellComponent::m_minHeight)
  215. ->Field("TargetWidthOverridden", &UiLayoutCellComponent::m_targetWidthOverridden)
  216. ->Field("TargetWidth", &UiLayoutCellComponent::m_targetWidth)
  217. ->Field("TargetHeightOverridden", &UiLayoutCellComponent::m_targetHeightOverridden)
  218. ->Field("TargetHeight", &UiLayoutCellComponent::m_targetHeight)
  219. ->Field("MaxWidthOverridden", &UiLayoutCellComponent::m_maxWidthOverridden)
  220. ->Field("MaxWidth", &UiLayoutCellComponent::m_maxWidth)
  221. ->Field("MaxHeightOverridden", &UiLayoutCellComponent::m_maxHeightOverridden)
  222. ->Field("MaxHeight", &UiLayoutCellComponent::m_maxHeight)
  223. ->Field("ExtraWidthRatioOverridden", &UiLayoutCellComponent::m_extraWidthRatioOverridden)
  224. ->Field("ExtraWidthRatio", &UiLayoutCellComponent::m_extraWidthRatio)
  225. ->Field("ExtraHeightRatioOverridden", &UiLayoutCellComponent::m_extraHeightRatioOverridden)
  226. ->Field("ExtraHeightRatio", &UiLayoutCellComponent::m_extraHeightRatio);
  227. AZ::EditContext* ec = serializeContext->GetEditContext();
  228. if (ec)
  229. {
  230. auto editInfo = ec->Class<UiLayoutCellComponent>("LayoutCell", "Allows default layout cell properties to be overridden.");
  231. editInfo->ClassElement(AZ::Edit::ClassElements::EditorData, "")
  232. ->Attribute(AZ::Edit::Attributes::Category, "UI")
  233. ->Attribute(AZ::Edit::Attributes::Icon, "Editor/Icons/Components/UiLayoutCell.png")
  234. ->Attribute(AZ::Edit::Attributes::ViewportIcon, "Editor/Icons/Components/Viewport/UiLayoutCell.png")
  235. ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("UI", 0x27ff46b0))
  236. ->Attribute(AZ::Edit::Attributes::AutoExpand, true);
  237. editInfo->DataElement(AZ::Edit::UIHandlers::CheckBox, &UiLayoutCellComponent::m_minWidthOverridden, "Min Width",
  238. "Check this box to override the minimum width.")
  239. ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ_CRC("RefreshEntireTree", 0xefbc823c))
  240. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  241. editInfo->DataElement(0, &UiLayoutCellComponent::m_minWidth, "Value",
  242. "Specify minimum width.")
  243. ->Attribute(AZ::Edit::Attributes::Min, 0.0f)
  244. ->Attribute(AZ::Edit::Attributes::Visibility, &UiLayoutCellComponent::m_minWidthOverridden)
  245. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  246. editInfo->DataElement(AZ::Edit::UIHandlers::CheckBox, &UiLayoutCellComponent::m_minHeightOverridden, "Min Height",
  247. "Check this box to override the minimum height.")
  248. ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ_CRC("RefreshEntireTree", 0xefbc823c))
  249. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  250. editInfo->DataElement(0, &UiLayoutCellComponent::m_minHeight, "Value",
  251. "Specify minimum height.")
  252. ->Attribute(AZ::Edit::Attributes::Min, 0.0f)
  253. ->Attribute(AZ::Edit::Attributes::Visibility, &UiLayoutCellComponent::m_minHeightOverridden)
  254. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  255. editInfo->DataElement(AZ::Edit::UIHandlers::CheckBox, &UiLayoutCellComponent::m_targetWidthOverridden, "Target Width",
  256. "Check this box to override the target width.")
  257. ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ_CRC("RefreshEntireTree", 0xefbc823c))
  258. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  259. editInfo->DataElement(0, &UiLayoutCellComponent::m_targetWidth, "Value",
  260. "Specify target width.")
  261. ->Attribute(AZ::Edit::Attributes::Min, 0.0f)
  262. ->Attribute(AZ::Edit::Attributes::Visibility, &UiLayoutCellComponent::m_targetWidthOverridden)
  263. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  264. editInfo->DataElement(AZ::Edit::UIHandlers::CheckBox, &UiLayoutCellComponent::m_targetHeightOverridden, "Target Height",
  265. "Check this box to override the target height.")
  266. ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ_CRC("RefreshEntireTree", 0xefbc823c))
  267. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  268. editInfo->DataElement(0, &UiLayoutCellComponent::m_targetHeight, "Value",
  269. "Specify target height.")
  270. ->Attribute(AZ::Edit::Attributes::Min, 0.0f)
  271. ->Attribute(AZ::Edit::Attributes::Visibility, &UiLayoutCellComponent::m_targetHeightOverridden)
  272. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  273. editInfo->DataElement(AZ::Edit::UIHandlers::CheckBox, &UiLayoutCellComponent::m_maxWidthOverridden, "Max Width",
  274. "Check this box to override the max width.")
  275. ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ_CRC("RefreshEntireTree", 0xefbc823c))
  276. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  277. editInfo->DataElement(0, &UiLayoutCellComponent::m_maxWidth, "Value",
  278. "Specify max width.")
  279. ->Attribute(AZ::Edit::Attributes::Min, 0.0f)
  280. ->Attribute(AZ::Edit::Attributes::Visibility, &UiLayoutCellComponent::m_maxWidthOverridden)
  281. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  282. editInfo->DataElement(AZ::Edit::UIHandlers::CheckBox, &UiLayoutCellComponent::m_maxHeightOverridden, "Max Height",
  283. "Check this box to override the max height.")
  284. ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ_CRC("RefreshEntireTree", 0xefbc823c))
  285. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  286. editInfo->DataElement(0, &UiLayoutCellComponent::m_maxHeight, "Value",
  287. "Specify max height.")
  288. ->Attribute(AZ::Edit::Attributes::Min, 0.0f)
  289. ->Attribute(AZ::Edit::Attributes::Visibility, &UiLayoutCellComponent::m_maxHeightOverridden)
  290. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  291. editInfo->DataElement(AZ::Edit::UIHandlers::CheckBox, &UiLayoutCellComponent::m_extraWidthRatioOverridden, "Extra Width Ratio",
  292. "Check this box to override the extra width ratio.")
  293. ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ_CRC("RefreshEntireTree", 0xefbc823c))
  294. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  295. editInfo->DataElement(0, &UiLayoutCellComponent::m_extraWidthRatio, "Value",
  296. "Specify extra width ratio.")
  297. ->Attribute(AZ::Edit::Attributes::Min, 0.0f)
  298. ->Attribute(AZ::Edit::Attributes::Visibility, &UiLayoutCellComponent::m_extraWidthRatioOverridden)
  299. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  300. editInfo->DataElement(AZ::Edit::UIHandlers::CheckBox, &UiLayoutCellComponent::m_extraHeightRatioOverridden, "Extra Height Ratio",
  301. "Check this box to override the extra height ratio.")
  302. ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ_CRC("RefreshEntireTree", 0xefbc823c))
  303. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  304. editInfo->DataElement(0, &UiLayoutCellComponent::m_extraHeightRatio, "Value",
  305. "Specify extra height ratio.")
  306. ->Attribute(AZ::Edit::Attributes::Min, 0.0f)
  307. ->Attribute(AZ::Edit::Attributes::Visibility, &UiLayoutCellComponent::m_extraHeightRatioOverridden)
  308. ->Attribute(AZ::Edit::Attributes::ChangeNotify, &UiLayoutCellComponent::InvalidateLayout);
  309. }
  310. }
  311. AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context);
  312. if (behaviorContext)
  313. {
  314. behaviorContext->EBus<UiLayoutCellBus>("UiLayoutCellBus")
  315. ->Event("GetMinWidth", &UiLayoutCellBus::Events::GetMinWidth)
  316. ->Event("SetMinWidth", &UiLayoutCellBus::Events::SetMinWidth)
  317. ->Event("GetMinHeight", &UiLayoutCellBus::Events::GetMinHeight)
  318. ->Event("SetMinHeight", &UiLayoutCellBus::Events::SetMinHeight)
  319. ->Event("GetTargetWidth", &UiLayoutCellBus::Events::GetTargetWidth)
  320. ->Event("SetTargetWidth", &UiLayoutCellBus::Events::SetTargetWidth)
  321. ->Event("GetTargetHeight", &UiLayoutCellBus::Events::GetTargetHeight)
  322. ->Event("SetTargetHeight", &UiLayoutCellBus::Events::SetTargetHeight)
  323. ->Event("GetMaxWidth", &UiLayoutCellBus::Events::GetMaxWidth)
  324. ->Event("SetMaxWidth", &UiLayoutCellBus::Events::SetMaxWidth)
  325. ->Event("GetMaxHeight", &UiLayoutCellBus::Events::GetMaxHeight)
  326. ->Event("SetMaxHeight", &UiLayoutCellBus::Events::SetMaxHeight)
  327. ->Event("GetExtraWidthRatio", &UiLayoutCellBus::Events::GetExtraWidthRatio)
  328. ->Event("SetExtraWidthRatio", &UiLayoutCellBus::Events::SetExtraWidthRatio)
  329. ->Event("GetExtraHeightRatio", &UiLayoutCellBus::Events::GetExtraHeightRatio)
  330. ->Event("SetExtraHeightRatio", &UiLayoutCellBus::Events::SetExtraHeightRatio)
  331. ->VirtualProperty("MinWidth", "GetMinWidth", "SetMinWidth")
  332. ->VirtualProperty("MinHeight", "GetMinHeight", "SetMinHeight")
  333. ->VirtualProperty("TargetWidth", "GetTargetWidth", "SetTargetWidth")
  334. ->VirtualProperty("TargetHeight", "GetTargetHeight", "SetTargetHeight")
  335. ->VirtualProperty("MaxWidth", "GetMaxWidth", "SetMaxWidth")
  336. ->VirtualProperty("MaxHeight", "GetMaxHeight", "SetMaxHeight")
  337. ->VirtualProperty("ExtraWidthRatio", "GetExtraWidthRatio", "SetExtraWidthRatio")
  338. ->VirtualProperty("ExtraHeightRatio", "GetExtraHeightRatio", "SetExtraHeightRatio");
  339. behaviorContext->Constant("UiLayoutCellUnspecifiedSize", BehaviorConstant(LyShine::UiLayoutCellUnspecifiedSize));
  340. behaviorContext->Class<UiLayoutCellComponent>()->RequestBus("UiLayoutCellBus");
  341. }
  342. }
  343. ////////////////////////////////////////////////////////////////////////////////////////////////////
  344. // PROTECTED MEMBER FUNCTIONS
  345. ////////////////////////////////////////////////////////////////////////////////////////////////////
  346. ////////////////////////////////////////////////////////////////////////////////////////////////////
  347. void UiLayoutCellComponent::Activate()
  348. {
  349. UiLayoutCellBus::Handler::BusConnect(GetEntityId());
  350. // If this is the first time the entity has been activated this has no effect since the canvas
  351. // is not known. But if a LayoutCell component has just been pasted onto an existing entity
  352. // we need to invalidate the layout in case that affects things.
  353. InvalidateLayout();
  354. }
  355. ////////////////////////////////////////////////////////////////////////////////////////////////////
  356. void UiLayoutCellComponent::Deactivate()
  357. {
  358. UiLayoutCellBus::Handler::BusDisconnect();
  359. // We could be about to remove this component and then reactivate the entity
  360. // which could affect the layout if there is a parent layout component
  361. InvalidateLayout();
  362. }
  363. ////////////////////////////////////////////////////////////////////////////////////////////////////
  364. void UiLayoutCellComponent::InvalidateLayout()
  365. {
  366. // Invalidate the parent's layout
  367. AZ::EntityId canvasEntityId;
  368. UiElementBus::EventResult(canvasEntityId, GetEntityId(), &UiElementBus::Events::GetCanvasEntityId);
  369. UiLayoutManagerBus::Event(
  370. canvasEntityId, &UiLayoutManagerBus::Events::MarkToRecomputeLayoutsAffectedByLayoutCellChange, GetEntityId(), false);
  371. // Invalidate the element's layout
  372. UiLayoutManagerBus::Event(canvasEntityId, &UiLayoutManagerBus::Events::MarkToRecomputeLayout, GetEntityId());
  373. }