Just following this conversation.

On Fri, 29 Jul 2016 08:25:35 -0600, Matthew Flatt
<mfl...@cs.utah.edu> wrote:

>It may be that a guard against a 0-sized drawing dimension is needed.
>The right place for the guard might be in the `get-cr` method of
>
> gui-lib/mred/private/wx/common/backing-dc.rkt
>
>after `get-backing-size` is called. A zero dimension could be just
>increased to 1 before passing it to `get-backing-bitmap`. Can you try
>making that change to see if it solves the problem on your machine?

I don't see any obvious utility in being allowed to create a zero
sized bitmap.  Likewise a widget or a canvas.


Obviously, other people's MMV.   I've only done a few simple GUI
programs in Racket , so I don't have a good feel for how people might
use the GUI and graphics toolkits.  For whatever they may be worth, my
opinions on this subject come from years of working with Windows using
C++, and before that Toolbox programming in C back in the MacOS days
[before the Unix based systems].

E.g., Windows CreateBitmap() creates a 1x1 monochrome bitmap if you
pass a zero for either dimension - but in doing so it also ignores the
requested depth of the bitmap ... an error waiting to happen when you
go to use the bitmap which may be neither the size nor color depth you
requested.

IMO a zero dimension should be an error.  If you don't know how big
the bitmap should be, don't create it until you do.  Similarly when
resizing, setting any dimension to zero should be an error.

George

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to