fix bug that graphics::make({0, 0}) behaves differently between Windows
and Linux
This commit is contained in:
@@ -291,6 +291,12 @@ namespace paint
|
||||
{
|
||||
if(impl_->handle == nullptr || impl_->size != sz)
|
||||
{
|
||||
if (sz.empty())
|
||||
{
|
||||
release();
|
||||
return;
|
||||
}
|
||||
|
||||
//The object will be delete while dwptr_ is performing a release.
|
||||
drawable_type dw = new nana::detail::drawable_impl_type;
|
||||
//Reuse the old font
|
||||
@@ -342,7 +348,7 @@ namespace paint
|
||||
Display* disp = spec.open_display();
|
||||
int screen = DefaultScreen(disp);
|
||||
Window root = ::XRootWindow(disp, screen);
|
||||
dw->pixmap = ::XCreatePixmap(disp, root, (sz.width ? sz.width : 1), (sz.height ? sz.height : 1), DefaultDepth(disp, screen));
|
||||
dw->pixmap = ::XCreatePixmap(disp, root, sz.width, sz.height, DefaultDepth(disp, screen));
|
||||
dw->context = ::XCreateGC(disp, dw->pixmap, 0, 0);
|
||||
#if defined(NANA_USE_XFT)
|
||||
dw->xftdraw = ::XftDrawCreate(disp, dw->pixmap, spec.screen_visual(), spec.colormap());
|
||||
|
||||
Reference in New Issue
Block a user