Merge branch 'hotfix-1.6.2' into develop-1.7

This commit is contained in:
Jinhao 2018-09-16 23:15:38 +08:00
commit ee4bba1bee
2 changed files with 28 additions and 15 deletions

View File

@ -1,7 +1,7 @@
/*
* An Animation Implementation
* Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com)
* Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
@ -49,24 +49,18 @@ namespace nana
struct impl;
class performance_manager;
/// Non-copyable
animation(const animation&) = delete;
animation& operator=(const animation&) = delete;
public:
animation(std::size_t fps = 23);
~animation();
void push_back(frameset frms);
/*
void branch(const std::string& name, const frameset& frms)
{
impl_->branches[name].frames = frms;
}
animation(animation&&);
animation& operator=(animation&&);
void branch(const std::string& name, const frameset& frms, std::function<std::size_t(const std::string&, std::size_t, std::size_t&)> condition)
{
auto & br = impl_->branches[name];
br.frames = frms;
br.condition = condition;
}
*/
void push_back(frameset frms);
void looped(bool enable); ///< Enables or disables the animation repeating playback.

View File

@ -1,7 +1,7 @@
/*
* An Animation Implementation
* Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com)
* Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
@ -571,6 +571,25 @@ namespace nana
delete impl_;
}
animation::animation(animation&& rhs)
: impl_(rhs.impl_)
{
rhs.impl_ = new impl(23);
}
animation& animation::operator=(animation&& rhs)
{
if (this != &rhs)
{
auto imp = new impl{ 23 };
delete impl_;
impl_ = rhs.impl_;
rhs.impl_ = imp;
}
return *this;
}
void animation::push_back(frameset frms)
{
impl_->framesets.emplace_back(std::move(frms));