image::paste throws exception if graphics or image is empty

This commit is contained in:
Jinhao
2015-07-13 00:23:54 +08:00
parent 17556cae99
commit 1eb76307e4
15 changed files with 59 additions and 642 deletions

View File

@@ -201,7 +201,7 @@ namespace nana
case frame::kind::oneshot:
_m_render(outs, [&frmobj](paint::graphics& tar, const nana::point& pos)
{
frmobj.u.oneshot->paste(tar, pos.x, pos.y);
frmobj.u.oneshot->paste(tar, pos);
});
break;
case frame::kind::framebuilder:
@@ -230,7 +230,7 @@ namespace nana
switch(frmobj.type)
{
case frame::kind::oneshot:
frmobj.u.oneshot->paste(graph, pos.x, pos.y);
frmobj.u.oneshot->paste(graph, pos);
break;
case frame::kind::framebuilder:
if(rebuild_frame)

View File

@@ -258,7 +258,7 @@ namespace nana{ namespace drawerbase
}
if(attr_.icon)
attr_.icon->paste(graph, 3, (gsize.height - icon_sz.height) / 2);
attr_.icon->paste(graph, point{ 3, static_cast<int>(gsize.height - icon_sz.height) / 2 });
}
void trigger::_m_draw(graph_reference graph)

View File

@@ -1263,7 +1263,7 @@ namespace nana
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);
img->paste(graph, point{ attr.area.x + static_cast<int>(attr.area.width - size.width) / 2, attr.area.y + static_cast<int>(attr.area.height - size.height) / 2 });
}
}
}