Fixed regression from 4139b43cc9 (fixes #4215)

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.
This commit is contained in:
Charles Dang 2019-08-12 12:36:07 +11:00
parent 981ca4ebea
commit f46ed66f2c
2 changed files with 22 additions and 0 deletions

View file

@ -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),

View file

@ -69,6 +69,7 @@ public:
virtual void process_tooltip_string(int mousex, int mousey);
protected:
widget(const widget& o);
widget(CVideo& video, const bool auto_join=true);
virtual ~widget();