explicit conversion from point/size to rectangle
This commit is contained in:
parent
1bb9a09a8a
commit
28413b7f25
@ -98,10 +98,10 @@ namespace nana{
|
||||
|
||||
void _m_render_edge_nimbus(core_window_t* wd, const nana::rectangle & visual)
|
||||
{
|
||||
nana::rectangle r(visual);
|
||||
auto r = visual;
|
||||
r.pare_off(-static_cast<int>(weight()));
|
||||
nana::rectangle good_r;
|
||||
if(overlap(r, wd->root_graph->size(), good_r))
|
||||
rectangle good_r;
|
||||
if (overlap(r, rectangle{ wd->root_graph->size() }, good_r))
|
||||
{
|
||||
if( (good_r.x < wd->pos_root.x) || (good_r.y < wd->pos_root.y) ||
|
||||
(good_r.x + good_r.width > visual.x + visual.width) || (good_r.y + good_r.height > visual.y + visual.height))
|
||||
|
@ -46,7 +46,7 @@ namespace nana
|
||||
class event_arg
|
||||
{
|
||||
public:
|
||||
virtual ~event_arg();
|
||||
virtual ~event_arg() = default;
|
||||
|
||||
/// ignorable handlers behind the current one in a chain of event handlers will not get called.
|
||||
void stop_propagation() const;
|
||||
|
@ -574,7 +574,7 @@ namespace nana{ namespace widgets{ namespace skeletons
|
||||
virtual void nontext_render(graph_reference graph, int x, int y) override
|
||||
{
|
||||
if(size_ != image_.size())
|
||||
image_.stretch(image_.size(), graph, nana::rectangle(x, y, size_.width, size_.height));
|
||||
image_.stretch(::nana::rectangle{ image_.size() }, graph, nana::rectangle(x, y, size_.width, size_.height));
|
||||
else
|
||||
image_.paste(graph, x, y);
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ namespace nana
|
||||
|
||||
point pos() const;
|
||||
void move(int x, int y);
|
||||
//void move(const point&);
|
||||
void move(const point&);
|
||||
void move(const rectangle&);
|
||||
|
||||
void fgcolor(const nana::color&);
|
||||
|
@ -39,8 +39,6 @@ namespace nana
|
||||
//end class internal_scope_guard
|
||||
|
||||
//class event_arg
|
||||
event_arg::~event_arg(){}
|
||||
|
||||
void event_arg::stop_propagation() const
|
||||
{
|
||||
stop_propagation_ = true;
|
||||
|
@ -368,7 +368,7 @@ namespace nana
|
||||
void drawer::_m_bground_end()
|
||||
{
|
||||
if(core_window_->effect.bground && core_window_->effect.bground_fade_rate >= 0.01)
|
||||
core_window_->other.glass_buffer.blend(core_window_->other.glass_buffer.size(), graphics, nana::point(), core_window_->effect.bground_fade_rate);
|
||||
core_window_->other.glass_buffer.blend(::nana::rectangle{ core_window_->other.glass_buffer.size() }, graphics, nana::point(), core_window_->effect.bground_fade_rate);
|
||||
}
|
||||
|
||||
void drawer::_m_draw_dynamic_drawing_object()
|
||||
|
@ -174,7 +174,7 @@ namespace nana{
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return primary_monitor_size();
|
||||
return rectangle{ primary_monitor_size() };
|
||||
}
|
||||
|
||||
//platform-dependent
|
||||
|
@ -210,7 +210,7 @@ namespace nana
|
||||
beg = beg->parent;
|
||||
}
|
||||
|
||||
glass_buffer.bitblt(wd->dimension, beg->drawer.graphics, wd->pos_root - beg->pos_root);
|
||||
glass_buffer.bitblt(::nana::rectangle{ wd->dimension }, beg->drawer.graphics, wd->pos_root - beg->pos_root);
|
||||
|
||||
nana::rectangle r(wd->pos_owner, wd->dimension);
|
||||
for (auto i = layers.rbegin(), layers_rend = layers.rend(); i != layers_rend; ++i)
|
||||
@ -240,7 +240,7 @@ namespace nana
|
||||
}
|
||||
}
|
||||
else
|
||||
glass_buffer.bitblt(wd->dimension, wd->parent->drawer.graphics, wd->pos_owner);
|
||||
glass_buffer.bitblt(::nana::rectangle{ wd->dimension }, wd->parent->drawer.graphics, wd->pos_owner);
|
||||
|
||||
const rectangle r_of_wd{ wd->pos_owner, wd->dimension };
|
||||
for (auto child : wd->parent->children)
|
||||
|
@ -26,7 +26,7 @@ namespace nana
|
||||
{
|
||||
if(fade_rate_ < 0.001)
|
||||
return;
|
||||
graph.blend(graph.size(), API::bgcolor(wd), fade_rate_);
|
||||
graph.blend(::nana::rectangle{ graph.size() }, API::bgcolor(wd), fade_rate_);
|
||||
}
|
||||
private:
|
||||
const double fade_rate_;
|
||||
@ -42,7 +42,7 @@ namespace nana
|
||||
|
||||
void take_effect(window, graph_reference graph) const
|
||||
{
|
||||
graph.blur(graph.size(), radius_);
|
||||
graph.blur(::nana::rectangle{ graph.size() }, radius_);
|
||||
}
|
||||
private:
|
||||
const std::size_t radius_;
|
||||
|
@ -52,11 +52,13 @@ namespace nana
|
||||
|
||||
bool overlap(const rectangle& ir, const size& valid_input_area, const rectangle & dr, const size& valid_dst_area, rectangle& op_ir, rectangle& op_dr)
|
||||
{
|
||||
if(overlap(ir, valid_input_area, op_ir) == false)
|
||||
rectangle valid_r{ valid_input_area };
|
||||
if (overlap(ir, valid_r, op_ir) == false)
|
||||
return false;
|
||||
|
||||
valid_r = valid_dst_area;
|
||||
rectangle good_dr;
|
||||
if(overlap(dr, valid_dst_area, good_dr) == false)
|
||||
if (overlap(dr, valid_r, good_dr) == false)
|
||||
return false;
|
||||
|
||||
zoom(ir, op_ir, dr, op_dr);
|
||||
|
@ -282,7 +282,7 @@ namespace nana{ namespace drawerbase
|
||||
else
|
||||
e_state = element_state::disabled;
|
||||
|
||||
if (false == cite_.draw(graph, attr_.bgcolor, attr_.fgcolor, graph.size(), e_state))
|
||||
if (false == cite_.draw(graph, attr_.bgcolor, attr_.fgcolor, ::nana::rectangle{ graph.size() }, e_state))
|
||||
{
|
||||
if (bground_mode::basic != API::effects_bground_mode(wdg_->handle()))
|
||||
{
|
||||
|
@ -521,7 +521,7 @@ namespace nana
|
||||
}
|
||||
|
||||
nana::point pos((image_pixels_ - imgsz.width) / 2 + 2, (vpix - imgsz.height) / 2 + 2);
|
||||
img.stretch(img.size(), *graph_, nana::rectangle(pos, imgsz));
|
||||
img.stretch(::nana::rectangle{ img.size() }, *graph_, nana::rectangle(pos, imgsz));
|
||||
}
|
||||
private:
|
||||
std::vector<std::shared_ptr<item>> items_;
|
||||
|
@ -414,7 +414,7 @@ namespace nana
|
||||
r.y = static_cast<int>(newbuf.height() - r.height) / 2;
|
||||
newbuf.stretch(nzbuf, r);
|
||||
|
||||
nzbuf.blend(nzbuf.size(), dzbuf, nana::point(), fade * (count - i));
|
||||
nzbuf.blend(::nana::rectangle{ nzbuf.size() }, dzbuf, nana::point(), fade * (count - i));
|
||||
graph.bitblt(refpos.x, refpos.y, dzbuf);
|
||||
|
||||
API::update_window(*widget_);
|
||||
@ -442,7 +442,7 @@ namespace nana
|
||||
nzbuf.rectangle(true, colors::white);
|
||||
newbuf.stretch(nzbuf, r);
|
||||
|
||||
nzbuf.blend(nzbuf.size(), dzbuf, nana::point(), fade * (count - i));
|
||||
nzbuf.blend(::nana::rectangle{ nzbuf.size() }, dzbuf, nana::point(), fade * (count - i));
|
||||
graph.bitblt(refpos.x, refpos.y, dzbuf);
|
||||
|
||||
API::update_window(*widget_);
|
||||
|
@ -99,7 +99,7 @@ namespace nana
|
||||
nana::point to_pos(x, r.y + 2);
|
||||
to_pos.x += (image_pixels_ - imgsz.width) / 2;
|
||||
to_pos.y += (vpix - imgsz.height) / 2;
|
||||
item->image().stretch(item->image().size(), graph, nana::rectangle(to_pos, imgsz));
|
||||
item->image().stretch(::nana::rectangle{ item->image().size() }, graph, nana::rectangle(to_pos, imgsz));
|
||||
}
|
||||
x += (image_pixels_ + 2);
|
||||
}
|
||||
|
@ -1919,10 +1919,13 @@ namespace nana
|
||||
void hovered(index_type pos) override
|
||||
{
|
||||
auto offset = ess_->lister.distance(ess_->scroll.offset_y_dpl, pos);
|
||||
ess_->pointer_where.first = parts::lister;
|
||||
ess_->pointer_where.second = offset;
|
||||
|
||||
ess_->update();
|
||||
if (ess_->pointer_where.first != parts::lister || ess_->pointer_where.second != offset)
|
||||
{
|
||||
ess_->pointer_where.first = parts::lister;
|
||||
ess_->pointer_where.second = offset;
|
||||
ess_->update();
|
||||
}
|
||||
}
|
||||
private:
|
||||
essence_t * const ess_;
|
||||
@ -2386,8 +2389,12 @@ namespace nana
|
||||
auto i = inline_buffered_table.find(factory);
|
||||
if (i != inline_buffered_table.end())
|
||||
{
|
||||
if (!i->second.empty())
|
||||
pane_ptr = std::move(i->second.front());
|
||||
auto & panes = i->second;
|
||||
if (!panes.empty())
|
||||
{
|
||||
pane_ptr = std::move(panes.front());
|
||||
panes.pop_front();
|
||||
}
|
||||
}
|
||||
|
||||
if (!pane_ptr)
|
||||
@ -3034,7 +3041,7 @@ namespace nana
|
||||
if (y < content_r.y)
|
||||
pane_pos.y = y - content_r.y;
|
||||
|
||||
inline_wdg->pane_widget.move(pane_pos.x, pane_pos.y);
|
||||
inline_wdg->pane_widget.move(pane_pos);
|
||||
inline_wdg->pane_bottom.move(pane_r);
|
||||
}
|
||||
else
|
||||
|
@ -112,7 +112,7 @@ namespace nana
|
||||
|
||||
_m_draw_background(fit_size.width, fit_size.height);
|
||||
|
||||
backimg.image.stretch(valid_area, graph, { pos, fit_size });
|
||||
backimg.image.stretch(valid_area, graph, ::nana::rectangle{ pos, fit_size });
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -151,7 +151,7 @@ namespace nana
|
||||
_m_draw_background(graphsize.width, graphsize.height);
|
||||
|
||||
color invalid_clr_for_call;
|
||||
backimg.bground->draw(graph, invalid_clr_for_call, invalid_clr_for_call, graphsize, element_state::normal);
|
||||
backimg.bground->draw(graph, invalid_clr_for_call, invalid_clr_for_call, rectangle{ graphsize }, element_state::normal);
|
||||
}
|
||||
|
||||
graph.setsta();
|
||||
@ -171,7 +171,7 @@ namespace nana
|
||||
else if (bground.gradual_from == bground.gradual_to)
|
||||
graph->rectangle(true, bground.gradual_from);
|
||||
else
|
||||
graph->gradual_rectangle(graph->size(), bground.gradual_from, bground.gradual_to, !bground.horizontal);
|
||||
graph->gradual_rectangle(::nana::rectangle{ graph->size() }, bground.gradual_from, bground.gradual_to, !bground.horizontal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ namespace nana
|
||||
|
||||
void trigger::_m_draw_box(graph_reference graph)
|
||||
{
|
||||
rectangle r = graph.size();
|
||||
rectangle r{ graph.size() };
|
||||
graph.gradual_rectangle(r, colors::button_face_shadow_end, colors::button_face_shadow_start, true);
|
||||
::nana::color lt{ colors::gray }, rb{colors::white};
|
||||
graph.frame_rectangle(r, lt, lt, rb, rb);
|
||||
|
@ -132,7 +132,7 @@ namespace nana
|
||||
|
||||
_m_background(graph);
|
||||
|
||||
rectangle_rotator r(vertical_, graph.size());
|
||||
rectangle_rotator r(vertical_, ::nana::rectangle{ graph.size() });
|
||||
r.x_ref() = static_cast<int>(r.w() - fixedsize);
|
||||
r.w_ref() = fixedsize;
|
||||
|
||||
@ -159,7 +159,7 @@ namespace nana
|
||||
if (!metrics_.pressed || !_m_check())
|
||||
return;
|
||||
|
||||
nana::rectangle_rotator r(vertical_, graph.size());
|
||||
nana::rectangle_rotator r(vertical_, ::nana::rectangle{ graph.size() });
|
||||
if(metrics_.what == buttons::forward)
|
||||
{
|
||||
r.x_ref() = static_cast<int>(fixedsize);
|
||||
@ -253,7 +253,7 @@ namespace nana
|
||||
{
|
||||
if(_m_check())
|
||||
{
|
||||
rectangle_rotator r(vertical_, graph.size());
|
||||
rectangle_rotator r(vertical_, rectangle{ graph.size() });
|
||||
r.x_ref() = static_cast<int>(fixedsize + metrics_.scroll_pos);
|
||||
r.w_ref() = static_cast<unsigned>(metrics_.scroll_length);
|
||||
|
||||
|
@ -1285,7 +1285,7 @@ namespace nana{ namespace widgets
|
||||
if (!API::widget_borderless(this->window_))
|
||||
{
|
||||
::nana::facade<element::border> facade;
|
||||
facade.draw(graph, bgcolor, API::fgcolor(this->window_), API::window_size(this->window_), API::element_state(this->window_));
|
||||
facade.draw(graph, bgcolor, API::fgcolor(this->window_), ::nana::rectangle{ API::window_size(this->window_) }, API::element_state(this->window_));
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -2775,12 +2775,12 @@ namespace nana{ namespace widgets
|
||||
{
|
||||
//draw the whole text if it is a RTL text, because Arbic language is transformable.
|
||||
canvas.string({}, str, len);
|
||||
graph_.bitblt({ ent_pos, ::nana::size{ ent_pixels, canvas.height() } }, canvas, ::nana::point{ ent_off, 0 });
|
||||
graph_.bitblt(::nana::rectangle{ ent_pos, ::nana::size{ ent_pixels, canvas.height() } }, canvas, ::nana::point{ ent_off, 0 });
|
||||
}
|
||||
else
|
||||
{
|
||||
canvas.string({}, ent_begin, ent_end - ent_begin);
|
||||
graph_.bitblt({ ent_pos, ::nana::size{ ent_pixels, canvas.height() } }, canvas);
|
||||
graph_.bitblt(::nana::rectangle{ ent_pos, ::nana::size{ ent_pixels, canvas.height() } }, canvas);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2830,7 +2830,7 @@ namespace nana{ namespace widgets
|
||||
if (selected)
|
||||
{
|
||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
||||
graph_.rectangle({ text_pos, { str_w, line_h_pixels } }, true);
|
||||
graph_.rectangle(::nana::rectangle{ text_pos, { str_w, line_h_pixels } }, true);
|
||||
graph_.string(text_pos, ent.begin, len);
|
||||
}
|
||||
else
|
||||
@ -2839,7 +2839,7 @@ namespace nana{ namespace widgets
|
||||
text_pos.x += static_cast<int>(str_w);
|
||||
}
|
||||
if (selected)
|
||||
graph_.rectangle({ text_pos, { whitespace_w, line_h_pixels } }, true);
|
||||
graph_.rectangle(::nana::rectangle{ text_pos, { whitespace_w, line_h_pixels } }, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2876,7 +2876,7 @@ namespace nana{ namespace widgets
|
||||
//selected all
|
||||
if (a.x <= pos && str_end <= b.x)
|
||||
{
|
||||
graph_.rectangle({ text_pos, { str_w, line_h_pixels } }, true);
|
||||
graph_.rectangle(::nana::rectangle{ text_pos, { str_w, line_h_pixels } }, true);
|
||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
||||
graph_.string(text_pos, ent.begin, len);
|
||||
}
|
||||
@ -2906,7 +2906,7 @@ namespace nana{ namespace widgets
|
||||
part_pos.x += static_cast<int>(head_w);
|
||||
|
||||
//Draw selected part
|
||||
graph_.rectangle({ part_pos, { sel_w, line_h_pixels } }, true);
|
||||
graph_.rectangle(::nana::rectangle{ part_pos, { sel_w, line_h_pixels } }, true);
|
||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
||||
graph_.string(part_pos, ent.begin + (a.x - pos), endpos - a.x);
|
||||
|
||||
@ -2931,7 +2931,7 @@ namespace nana{ namespace widgets
|
||||
else
|
||||
{ //LTR
|
||||
//Draw selected part
|
||||
graph_.rectangle({ text_pos, { sel_w, line_h_pixels } }, true);
|
||||
graph_.rectangle(::nana::rectangle{ text_pos, { sel_w, line_h_pixels } }, true);
|
||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
||||
graph_.string(text_pos, ent.begin, endpos - pos);
|
||||
|
||||
@ -2957,7 +2957,7 @@ namespace nana{ namespace widgets
|
||||
if (a.x < pos)
|
||||
{
|
||||
//Draw selected all
|
||||
graph_.rectangle({ text_pos, { str_w, line_h_pixels } }, true, { 0x33, 0x99, 0xFF });
|
||||
graph_.rectangle(::nana::rectangle{ text_pos, { str_w, line_h_pixels } }, true, static_cast<color_rgb>(0x3399FF));
|
||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
||||
graph_.string(text_pos, ent.begin, len);
|
||||
}
|
||||
@ -2978,7 +2978,7 @@ namespace nana{ namespace widgets
|
||||
::nana::point part_pos{ text_pos.x + static_cast<int>(head_w), text_pos.y };
|
||||
|
||||
//Draw selected part
|
||||
graph_.rectangle({ part_pos, {str_w - head_w, line_h_pixels } }, true);
|
||||
graph_.rectangle(::nana::rectangle{ part_pos, {str_w - head_w, line_h_pixels } }, true);
|
||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
||||
graph_.string(part_pos, ent.begin + a.x - pos, len - (a.x - pos));
|
||||
}
|
||||
@ -2991,7 +2991,7 @@ namespace nana{ namespace widgets
|
||||
if (str_pos.y < b.y)
|
||||
{
|
||||
if (a.y < str_pos.y || ((a.y == str_pos.y) && (a.x <= str_pos.x )))
|
||||
graph_.rectangle({ text_pos, { whitespace_w, line_h_pixels } }, true);
|
||||
graph_.rectangle(::nana::rectangle{ text_pos, { whitespace_w, line_h_pixels } }, true);
|
||||
}
|
||||
}
|
||||
else if (b.y == str_pos.y)
|
||||
@ -3007,7 +3007,7 @@ namespace nana{ namespace widgets
|
||||
if (pos + len <= b.x)
|
||||
{
|
||||
//Draw selected part
|
||||
graph_.rectangle({ text_pos, { str_w, line_h_pixels } }, true);
|
||||
graph_.rectangle(::nana::rectangle{ text_pos, { str_w, line_h_pixels } }, true);
|
||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
||||
graph_.string(text_pos, ent.begin, len);
|
||||
}
|
||||
@ -3021,7 +3021,7 @@ namespace nana{ namespace widgets
|
||||
else
|
||||
{
|
||||
//draw selected part
|
||||
graph_.rectangle({ text_pos, { sel_w, line_h_pixels } }, true);
|
||||
graph_.rectangle(::nana::rectangle{ text_pos, { sel_w, line_h_pixels } }, true);
|
||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
||||
graph_.string(text_pos, ent.begin, b.x - pos);
|
||||
|
||||
|
@ -55,7 +55,7 @@ namespace nana
|
||||
|
||||
virtual void slider(window, graph_reference graph, const slider_t& s)
|
||||
{
|
||||
nana::rectangle r = graph.size();
|
||||
nana::rectangle r{ graph.size() };
|
||||
if(s.horizontal)
|
||||
{
|
||||
r.x = s.pos;
|
||||
@ -390,7 +390,7 @@ namespace nana
|
||||
nana::rectangle _m_bar_area() const
|
||||
{
|
||||
auto sz = other_.graph->size();
|
||||
nana::rectangle r = sz;
|
||||
nana::rectangle r{ sz };
|
||||
if(style::horizontal == attr_.dir)
|
||||
{
|
||||
r.x = attr_.slider_scale / 2 - attr_.border;
|
||||
|
@ -947,7 +947,7 @@ namespace nana
|
||||
auto bgcolor = API::bgcolor(basis_.wd);
|
||||
auto fgcolor = API::fgcolor(basis_.wd);
|
||||
|
||||
item_renderer::item_t m = { basis_.graph->size() };
|
||||
item_renderer::item_t m{ ::nana::rectangle{ basis_.graph->size() } };
|
||||
|
||||
basis_.renderer->background(*basis_.graph, m.r, bgcolor);
|
||||
|
||||
@ -985,7 +985,7 @@ namespace nana
|
||||
}
|
||||
|
||||
if(false == item.img.empty())
|
||||
item.img.stretch(item.img.size(), *basis_.graph, nana::rectangle(m.r.x + 4, (m.r.height - 16) / 2, 16, 16));
|
||||
item.img.stretch(::nana::rectangle{ item.img.size() }, *basis_.graph, nana::rectangle(m.r.x + 4, (m.r.height - 16) / 2, 16, 16));
|
||||
|
||||
if(item.text.size())
|
||||
{
|
||||
|
@ -174,11 +174,11 @@ namespace nana
|
||||
pos.x += static_cast<int>(scale + extra_size - size.width) / 2;
|
||||
pos.y += static_cast<int>(height - size.height) / 2;
|
||||
|
||||
item.image.paste(size, graph, pos);
|
||||
item.image.paste(::nana::rectangle{ size }, graph, pos);
|
||||
if(item.enable == false)
|
||||
{
|
||||
nana::paint::graphics gh(size);
|
||||
gh.bitblt(size, graph, pos);
|
||||
gh.bitblt(::nana::rectangle{ size }, graph, pos);
|
||||
gh.rgb_to_wb();
|
||||
gh.paste(graph, pos.x, pos.y);
|
||||
}
|
||||
@ -400,7 +400,7 @@ namespace nana
|
||||
|
||||
void drawer::_m_draw_background(const ::nana::color& clr)
|
||||
{
|
||||
graph_->gradual_rectangle(graph_->size(), clr.blend(colors::white, 0.9), clr.blend(colors::black, 0.95), true);
|
||||
graph_->gradual_rectangle(::nana::rectangle{ graph_->size() }, clr.blend(colors::white, 0.9), clr.blend(colors::black, 0.95), true);
|
||||
}
|
||||
|
||||
void drawer::_m_draw()
|
||||
|
@ -1260,7 +1260,7 @@ namespace nana
|
||||
attr.area.x += (attr.area.width - fit_size.width) / 2;
|
||||
attr.area.y += (attr.area.height - fit_size.height) / 2;
|
||||
attr.area = fit_size;
|
||||
img->stretch(size, graph, attr.area);
|
||||
img->stretch(::nana::rectangle{ size }, graph, attr.area);
|
||||
}
|
||||
else
|
||||
img->paste(graph, attr.area.x + static_cast<int>(attr.area.width - size.width) / 2, attr.area.y + static_cast<int>(attr.area.height - size.height) / 2);
|
||||
|
@ -173,12 +173,10 @@ namespace nana
|
||||
_m_move(x, y);
|
||||
}
|
||||
|
||||
/*
|
||||
void widget::move(const point& pos) //deprecated
|
||||
void widget::move(const point& pos)
|
||||
{
|
||||
_m_move(pos);
|
||||
_m_move(pos.x, pos.y);
|
||||
}
|
||||
*/
|
||||
|
||||
void widget::move(const rectangle& r)
|
||||
{
|
||||
|
@ -98,13 +98,13 @@ namespace detail
|
||||
return bgcolor;
|
||||
}
|
||||
|
||||
void blend(drawable_type dw, const nana::rectangle& area, pixel_color_t color, double fade_rate)
|
||||
void blend(drawable_type dw, const rectangle& area, pixel_color_t color, double fade_rate)
|
||||
{
|
||||
if(fade_rate <= 0) return;
|
||||
if(fade_rate > 1) fade_rate = 1;
|
||||
|
||||
nana::rectangle r;
|
||||
if(false == nana::overlap(drawable_size(dw), area, r))
|
||||
rectangle r;
|
||||
if (false == ::nana::overlap(rectangle{ drawable_size(dw) }, area, r))
|
||||
return;
|
||||
|
||||
unsigned red = static_cast<unsigned>((color.value & 0xFF0000) * fade_rate);
|
||||
|
@ -604,7 +604,7 @@ namespace paint
|
||||
if(dst.handle_ && handle_ && (dst.handle_ != handle_))
|
||||
{
|
||||
pixel_buffer s_pixbuf;
|
||||
s_pixbuf.attach(handle_, size());
|
||||
s_pixbuf.attach(handle_, ::nana::rectangle{ size() });
|
||||
|
||||
s_pixbuf.blend(s_r, dst.handle_, d_pos, fade_rate);
|
||||
|
||||
@ -1022,13 +1022,13 @@ namespace paint
|
||||
|
||||
void graphics::rectangle(bool solid)
|
||||
{
|
||||
rectangle(size(), solid);
|
||||
rectangle(::nana::rectangle{ size() }, solid);
|
||||
}
|
||||
|
||||
void graphics::rectangle(bool solid, const ::nana::color& clr)
|
||||
{
|
||||
set_color(clr);
|
||||
rectangle(size(), solid);
|
||||
rectangle(::nana::rectangle{ size() }, solid);
|
||||
}
|
||||
|
||||
void graphics::rectangle(const ::nana::rectangle& r, bool solid)
|
||||
|
@ -263,7 +263,7 @@ namespace paint
|
||||
void image::paste(graphics& dst, int x, int y) const
|
||||
{
|
||||
if(image_ptr_)
|
||||
image_ptr_->paste(image_ptr_->size(), dst, x, y);
|
||||
image_ptr_->paste(::nana::rectangle{ image_ptr_->size() }, dst, x, y);
|
||||
}
|
||||
|
||||
void image::paste(const nana::rectangle& r_src, graphics & dst, const nana::point& p_dst) const
|
||||
|
@ -22,10 +22,10 @@
|
||||
|
||||
namespace nana{ namespace paint
|
||||
{
|
||||
nana::rectangle valid_rectangle(const nana::size& s, const nana::rectangle& r)
|
||||
nana::rectangle valid_rectangle(const size& s, const rectangle& r)
|
||||
{
|
||||
nana::rectangle good_r;
|
||||
nana::overlap(s, r, good_r);
|
||||
nana::overlap(rectangle{ s }, r, good_r);
|
||||
return good_r;
|
||||
}
|
||||
|
||||
@ -384,13 +384,13 @@ namespace nana{ namespace paint
|
||||
close();
|
||||
}
|
||||
|
||||
void pixel_buffer::attach(drawable_type drawable, const nana::rectangle& want_r)
|
||||
void pixel_buffer::attach(drawable_type drawable, const ::nana::rectangle& want_r)
|
||||
{
|
||||
storage_.reset();
|
||||
if(drawable)
|
||||
{
|
||||
nana::rectangle r;
|
||||
if(nana::overlap(nana::paint::detail::drawable_size(drawable), want_r, r))
|
||||
if (::nana::overlap(::nana::rectangle{ nana::paint::detail::drawable_size(drawable) }, want_r, r))
|
||||
storage_ = std::make_shared<pixel_buffer_storage>(drawable, r);
|
||||
}
|
||||
}
|
||||
@ -429,16 +429,16 @@ namespace nana{ namespace paint
|
||||
|
||||
bool pixel_buffer::open(drawable_type drawable, const nana::rectangle & want_rectangle)
|
||||
{
|
||||
nana::size sz = nana::paint::detail::drawable_size(drawable);
|
||||
auto sz = nana::paint::detail::drawable_size(drawable);
|
||||
if(want_rectangle.x >= static_cast<int>(sz.width) || want_rectangle.y >= static_cast<int>(sz.height))
|
||||
return false;
|
||||
|
||||
nana::rectangle want_r = want_rectangle;
|
||||
auto want_r = want_rectangle;
|
||||
if(want_r.width == 0) want_r.width = sz.width - want_r.x;
|
||||
if(want_r.height == 0) want_r.height = sz.height - want_r.y;
|
||||
|
||||
nana::rectangle r;
|
||||
if(false == overlap(sz, want_r, r))
|
||||
::nana::rectangle r;
|
||||
if (false == overlap(::nana::rectangle{ sz }, want_r, r))
|
||||
return false;
|
||||
#if defined(NANA_WINDOWS)
|
||||
BITMAPINFO bmpinfo;
|
||||
@ -1039,13 +1039,13 @@ namespace nana{ namespace paint
|
||||
}
|
||||
}
|
||||
|
||||
void pixel_buffer::blur(const nana::rectangle& r, std::size_t radius)
|
||||
void pixel_buffer::blur(const ::nana::rectangle& r, std::size_t radius)
|
||||
{
|
||||
auto sp = storage_.get();
|
||||
if(nullptr == sp || radius < 1) return;
|
||||
|
||||
nana::rectangle good_r;
|
||||
if(overlap(r, this->size(), good_r))
|
||||
::nana::rectangle good_r;
|
||||
if (overlap(r, ::nana::rectangle{ this->size() }, good_r))
|
||||
(*(sp->img_pro.blur))->process(*this, good_r, radius);
|
||||
}
|
||||
}//end namespace paint
|
||||
|
Loading…
x
Reference in New Issue
Block a user