Skip to content

Commit

Permalink
netanim: Add helper function to update the size of a node
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
a-andre authored and tomhenderson committed Nov 13, 2022
1 parent adcc13e commit c41057b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/netanim/model/animation-interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,12 @@ AnimationInterface::SetBackgroundImage(std::string fileName,
WriteXmlUpdateBackground(fileName, x, y, scaleX, scaleY, opacity);
}

void
AnimationInterface::UpdateNodeSize(Ptr<Node> n, double width, double height)
{
UpdateNodeSize(n->GetId(), width, height);
}

void
AnimationInterface::UpdateNodeSize(uint32_t nodeId, double width, double height)
{
Expand Down
9 changes: 9 additions & 0 deletions src/netanim/model/animation-interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Node> n, double width, double height);

/**
* \brief Helper function to update the size of a node
* \param nodeId Id of the node
Expand Down

0 comments on commit c41057b

Please sign in to comment.