Skip to content

Commit

Permalink
Fixed regression from 4139b43 (fixes #4215)
Browse files Browse the repository at this point in the history
This fixes the buttons in the editor's terrain palette being unselectable. Since the gui::widget class
had a virtual base class, the class was not trivially copy-constructable. We need to explicitly define
the copy constructor so we can initialize the sdl_handler base class.
  • Loading branch information
Vultraz committed Aug 12, 2019
1 parent aa34fcc commit 93afff1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/widgets/widget.cpp
Expand Up @@ -30,6 +30,27 @@ namespace gui {

bool widget::mouse_lock_ = false;

widget::widget(const widget& o)
: events::sdl_handler()
, focus_(o.focus_)
, video_(o.video_)
, restorer_(o.restorer_)
, rect_(o.rect_)
, needs_restore_(o.needs_restore_)
, state_(o.state_)
, hidden_override_(o.hidden_override_)
, enabled_(o.enabled_)
, clip_(o.clip_)
, clip_rect_(o.clip_rect_)
, volatile_(o.volatile_)
, help_text_(o.help_text_)
, tooltip_text_(o.tooltip_text_)
, help_string_(o.help_string_)
, id_(o.id_)
, mouse_lock_local_(o.mouse_lock_local_)
{
}

widget::widget(CVideo& video, const bool auto_join)
: events::sdl_handler(auto_join), focus_(true), video_(&video), rect_(EmptyRect), needs_restore_(false),
state_(UNINIT), hidden_override_(false), enabled_(true), clip_(false),
Expand Down
1 change: 1 addition & 0 deletions src/widgets/widget.hpp
Expand Up @@ -69,6 +69,7 @@ class widget : public events::sdl_handler
virtual void process_tooltip_string(int mousex, int mousey);

protected:
widget(const widget& o);
widget(CVideo& video, const bool auto_join=true);
virtual ~widget();

Expand Down

0 comments on commit 93afff1

Please sign in to comment.