From 2beb01db001c9c22e4865fba3ba9b46ff5fc2dda Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 4 Oct 2001 19:15:17 +0000 Subject: [PATCH] Don't create a bitmap with dimensions <= 0... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11837 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/stc/PlatWX.cpp | 2 ++ src/stc/PlatWX.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/contrib/src/stc/PlatWX.cpp b/contrib/src/stc/PlatWX.cpp index 29535072a7..ae53b19b54 100644 --- a/contrib/src/stc/PlatWX.cpp +++ b/contrib/src/stc/PlatWX.cpp @@ -174,6 +174,8 @@ void Surface::InitPixMap(int width, int height, Surface *surface_) { Release(); hdc = new wxMemoryDC(surface_->hdc); hdcOwned = true; + if (width < 1) width = 1; + if (height < 1) height = 1; bitmap = new wxBitmap(width, height); ((wxMemoryDC*)hdc)->SelectObject(*bitmap); } diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 29535072a7..ae53b19b54 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -174,6 +174,8 @@ void Surface::InitPixMap(int width, int height, Surface *surface_) { Release(); hdc = new wxMemoryDC(surface_->hdc); hdcOwned = true; + if (width < 1) width = 1; + if (height < 1) height = 1; bitmap = new wxBitmap(width, height); ((wxMemoryDC*)hdc)->SelectObject(*bitmap); } -- 2.47.2