From c41057b47edd94cea6a11bb57c32e57fc15dfc32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Apitzsch?= Date: Thu, 10 Nov 2022 09:41:07 +0100 Subject: [PATCH] netanim: Add helper function to update the size of a node This function allows passing a pointer to update the size of a node, like it is already available for updating the color or description of a node. --- src/netanim/model/animation-interface.cc | 6 ++++++ src/netanim/model/animation-interface.h | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/src/netanim/model/animation-interface.cc b/src/netanim/model/animation-interface.cc index a9192ec1f..2e5a2af85 100644 --- a/src/netanim/model/animation-interface.cc +++ b/src/netanim/model/animation-interface.cc @@ -376,6 +376,12 @@ AnimationInterface::SetBackgroundImage(std::string fileName, WriteXmlUpdateBackground(fileName, x, y, scaleX, scaleY, opacity); } +void +AnimationInterface::UpdateNodeSize(Ptr n, double width, double height) +{ + UpdateNodeSize(n->GetId(), width, height); +} + void AnimationInterface::UpdateNodeSize(uint32_t nodeId, double width, double height) { diff --git a/src/netanim/model/animation-interface.h b/src/netanim/model/animation-interface.h index 8149a9980..65610cf2b 100644 --- a/src/netanim/model/animation-interface.h +++ b/src/netanim/model/animation-interface.h @@ -284,6 +284,15 @@ class AnimationInterface */ void UpdateNodeImage(uint32_t nodeId, uint32_t resourceId); + /** + * \brief Helper function to update the size of a node + * \param n Ptr to the node + * \param width Width of the node + * \param height Height of the node + * + */ + void UpdateNodeSize(Ptr n, double width, double height); + /** * \brief Helper function to update the size of a node * \param nodeId Id of the node