Interesting problem. I need to dig a bit deeper, but suspect fixing it may beyond the scope of the 601 release.

The problem is that the memory buffer for an isigraph's pixels is only created 'when necessary'. Your h isigraph is hidden and doesn't get paint events when resized and what surprises me is that a buffer is ever created for it, not that it isn't recreated at the right size. Your setxywhx sets the size of control, but a new resized pixel buffer will only be created when a paint event is triggered and this doesn't happen as the control is hidden. I need to look into the interaction with glpaint. So the normal mechanisms that create a pixel buffer of the right size are not triggered so the drawing is done (and clipped) to whatever size happens to be there in the first place.

It might be nice if the setxywhx triggered the pixel buffer resize, but as I say this may be be too complicated for this release.

There may be some workarounds that let you get what you want. A crude (very memory intensive) workaround is to do the initial create of h at a large size and not do the setxywhx in the g paint event.

Or perhaps instead of having h as hidden in the same form, create a new form with h of the right size (with the form not shown) and use it. But this also may not have a drawing buffer initialized so you would have to try it to see if it worked.

----- Original Message ----- From: "Oleg Kobchenko" <[EMAIL PROTECTED]>
To: "Beta forum" <beta@jsoftware.com>
Sent: Thursday, August 10, 2006 5:18 PM
Subject: Re: [Jbeta] Black rectangle in isigraph and error


Here is an example of simplified offscreen canvas.

It is done with another hidden isigraph, which should
be two times as large as the on-screen one.

It has to support resizing, so the off-screen isigraph
is dynamically resized.

But black rectangles appear when the window
is resized beyond its original size.


NB. =========================================================

require 'gl2'
coinsert 'jgl2'

F=: 0 : 0
pc f;pn "Font Fit";
xywh 6 6 160 120;cc g isigraph rightmove bottommove;
pas 6 6;pcenter;
rem form end;
)

f_run=: 3 : 0
 wd F
 wd 'xywh 0 0 10 10; cc h isigraph;'
 wd 'setshow h 0;'
 wd 'pshow;'
)

av2=: _2&((+/ <[EMAIL PROTECTED] #)\)

f_g_paint=: 3 : 0
 glsel 'g'
 wh=. 2*glqwh''
 wd 'setxywhx h 0 0 ',":wh

 glsel 'h'
 glclear ''
 glbrush                      glrgb 3#200
 glpen   <.(0.01*-:+/wh), 0 [ glrgb 3#100
 glellipse ,0.1 0.8 <[EMAIL PROTECTED]/ wh
 glpaint ''

 $q=. (|.wh)$glqpixels 0 0,wh
 q=. 16b010101*av2 av2&.|: 256|q

 glsel 'g'
 glclear ''
 glpixels 0 0,(|.$q),,q
 glpaint ''
)

f_close=: 3 : 0
 wd'pclose'
)

f_run ''


--- Eric Iverson <[EMAIL PROTECTED]> wrote:

The non-unique sparse elements is due to a wd bug. I forget the details.
One variant of this has been fixed in the next beta so please test
again. A buffer overflow, rather than resizing and continuing, gets
confused as an error with a curious number.

----- Original Message ----- From: "Oleg Kobchenko" <[EMAIL PROTECTED]>
To: "Beta forum" <beta@jsoftware.com>
Sent: Thursday, August 10, 2006 2:07 PM
Subject: [Jbeta] Black rectangle in isigraph and error


>I have been experimenting with offscreen
> isisgraph which is resized with other
> visible isisgraph as shown in fontscale.ijs.
>
> http://www.jsoftware.com/jwiki/Scripts/Font_Fit
>
> In addition to the issue with black rectangles,
> when you resize the window large engough,
> in the end, when closign J it gives
>
> |non-unique sparse elements: wd
> |   wdq=:    wd'q'
>
> But more testing probably is required.
> I just report because I never saw such error before.
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> ----------------------------------------------------------------------
> For information about J forums see > http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to