forked from NaiJi/project-kyoku
Remove unnecessary argument in resetRect of CascadeMenuButton
This commit is contained in:
parent
4093963706
commit
788cd090f2
|
@ -43,7 +43,7 @@ Editor::Editor(sf::RenderWindow& game_window, Callbacks&& callbacks, std::unique
|
|||
test_menu->addCascadeButton(test_cascade_button);
|
||||
test_menu->addPushButton(quit_button);
|
||||
|
||||
test_cascade_button->resetRect(test_menu_2);
|
||||
test_cascade_button->resetRect();
|
||||
|
||||
_music->openFromFile("Uta-test.flac");
|
||||
_music->setVolume(5);
|
||||
|
|
|
@ -41,13 +41,13 @@ void CascadeMenuButton::input(const sf::Event& event)
|
|||
void CascadeMenuButton::setRect(const sf::FloatRect& rect)
|
||||
{
|
||||
Button::setRect(rect);
|
||||
resetRect(_submenu);
|
||||
resetRect();
|
||||
}
|
||||
|
||||
void CascadeMenuButton::setSubmenu(const std::shared_ptr<MenuDrop>& submenu)
|
||||
{
|
||||
_submenu = submenu;
|
||||
resetRect(_submenu);
|
||||
resetRect();
|
||||
}
|
||||
|
||||
const std::shared_ptr<MenuDrop> CascadeMenuButton::submenu() const
|
||||
|
@ -55,11 +55,11 @@ const std::shared_ptr<MenuDrop> CascadeMenuButton::submenu() const
|
|||
return _submenu;
|
||||
}
|
||||
|
||||
void CascadeMenuButton::resetRect(const std::shared_ptr<MenuDrop>& submenu)
|
||||
void CascadeMenuButton::resetRect()
|
||||
{
|
||||
if (submenu)
|
||||
if (_submenu)
|
||||
{
|
||||
submenu->setPosition({_button_content.getPosition().x + _button_content.getSize().x,
|
||||
_submenu->setPosition({_button_content.getPosition().x + _button_content.getSize().x,
|
||||
_button_content.getPosition().y});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ public:
|
|||
|
||||
void setSubmenu(const std::shared_ptr<MenuDrop>& submenu);
|
||||
const std::shared_ptr<MenuDrop> submenu() const;
|
||||
void resetRect(const std::shared_ptr<MenuDrop>& submenu);
|
||||
void resetRect();
|
||||
void setFillColors(sf::Color&& idle_color, sf::Color&& hover_color);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue