fix issue that graphics::gradual_rectangle modifies fgcolor unexpectedly

This commit is contained in:
Jinhao
2017-06-04 05:47:57 +08:00
parent 42f89854fd
commit d384a6a8e7
6 changed files with 8 additions and 52 deletions

View File

@@ -1208,7 +1208,8 @@ namespace paint
unsigned last_color = (int(r) << 16) | (int(g) << 8) | int(b);
Display * disp = nana::detail::platform_spec::instance().open_display();
impl_->handle->fgcolor(static_cast<color_rgb>(last_color));
impl_->handle->set_color(static_cast<color_rgb>(last_color));
impl_->handle->update_color();
const int endpos = deltapx + (vertical ? rct.y : rct.x);
if (endpos > 0)
{
@@ -1223,7 +1224,8 @@ namespace paint
if (new_color != last_color)
{
last_color = new_color;
impl_->handle->fgcolor(static_cast<color_rgb>(last_color));
impl_->handle->set_color(static_cast<color_rgb>(last_color));
impl_->handle->update_color();
}
}
}
@@ -1238,7 +1240,8 @@ namespace paint
if (new_color != last_color)
{
last_color = new_color;
impl_->handle->fgcolor(static_cast<color_rgb>(last_color));
impl_->handle->set_color(static_cast<color_rgb>(last_color));
impl_->handle->update_color();
}
}
}