refactor functions

This commit is contained in:
Jinhao
2017-05-31 22:36:56 +08:00
parent 5746fc33f6
commit a87703d418
9 changed files with 121 additions and 143 deletions

View File

@@ -509,9 +509,7 @@ namespace paint
nana::size sz;
if(impl_->handle && impl_->handle->context && str.size())
{
std::vector<unicode_bidi::entity> reordered;
unicode_bidi bidi;
bidi.linestr(str.c_str(), str.size(), reordered);
auto const reordered = unicode_reorder(str.c_str(), str.size());
for(auto & i: reordered)
{
nana::size t = text_extent_size(i.begin, i.end - i.begin);
@@ -958,9 +956,8 @@ namespace paint
unsigned graphics::bidi_string(const nana::point& pos, const wchar_t * str, std::size_t len)
{
auto moved_pos = pos;
unicode_bidi bidi;
std::vector<unicode_bidi::entity> reordered;
bidi.linestr(str, len, reordered);
auto const reordered = unicode_reorder(str, len);
for (auto & i : reordered)
{
string(moved_pos, i.begin, i.end - i.begin);