image::paste throws exception if graphics or image is empty
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user