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

@@ -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 });
}
}
}