Skip to content

Commit

Permalink
More fix for Misc elements issues #216 Item 1.a (Add cast utility tha…
Browse files Browse the repository at this point in the history
…t deals with indirect elements)
  • Loading branch information
djowel committed Aug 26, 2020
1 parent e8a76d3 commit 7bb2db7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/src/element/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ namespace cycfi { namespace elements
{
for (std::size_t i = 0; i != c->size(); ++i)
{
if (auto e = dynamic_cast<selectable*>(&c->at(i)))
if (auto e = find_element<selectable*>(&c->at(i)))
e->select(false);
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/src/element/port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Distributed under the MIT License [ https://opensource.org/licenses/MIT ]
=============================================================================*/
#include <elements/element/port.hpp>
#include <elements/element/traversal.hpp>
#include <elements/view.hpp>
#include <algorithm>
#include <cmath>
Expand Down Expand Up @@ -77,7 +78,7 @@ namespace cycfi { namespace elements
auto const* ctx = &ctx_;
while (ctx && ctx->element)
{
auto* sp = dynamic_cast<scrollable*>(ctx->element);
auto* sp = find_element<scrollable*>(ctx->element);
if (sp)
return { ctx, sp };
else
Expand Down

0 comments on commit 7bb2db7

Please sign in to comment.