Re: [Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d

2024-04-28 Thread Blady via Gnoga-list

> Le 12 mars 2024 à 13:37, Wayne Bullaughey via Gnoga-list 
>  a écrit :
> 
> Soon after my application starts a call to Swap_Connection occurs.  Within 60 
> seconds of that I get the following:
> 
> 2024-03-12 08:28:17.87 : Deleting connection - 2
> 2024-03-12 08:28:17.88 : Watchdog error.
> 2024-03-12 08:28:17.88 : raised ADA.ASSERTIONS.ASSERTION_ERROR : Position 
> cursor of Next is bad
> Load address: 0x1027bf000
> Call stack traceback locations:
> 0x102b45091 0x102a1d6e0 0x102a3929b 0x102a3931f 0x102a402d6 0x102b0d008 
> 0x7ff8053f7200
> 
> I prevented this from happening by adding the following lines in the 
> procedure Delete_Connection in the file gnoga-server-connection.adb.
> 
> if Socket_Maps.Key (Current_Socket) = ID then
>   Current_Socket := Socket_Maps.No_Element;
> end if;
> 
> After the line:
> 
> if Socket_Map.Contains (ID) then

Hello Wayne,

Which is your Gnoga version running?
It reminds me an old issue with Watchdog.

Regards, Pascal.



___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list


Re: [Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d

2024-03-21 Thread Blady via Gnoga-list

> Le 21 mars 2024 à 21:07, Wayne Bullaughey via Gnoga-list 
>  a écrit :
> 
> gnoga.ads has 1.2b. Is that the official version?

Hello Wayne,

Gnoga 1.2 is the last version from archive.

You can get version 1.6a stable with GIT: 
https://sourceforge.net/p/gnoga/code/ci/V1.6a/tree/
Versions 1.x will have only error fixes.

Or switch to version 2.1a stable from archive: 
https://sourceforge.net/projects/gnoga/files/gnoga-2.1a.zip/download
Versions 2.x have Unicode support and are the ongoing dev.

Regards, Pascal.



___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list


Re: [Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d

2024-03-21 Thread Wayne Bullaughey via Gnoga-list
gnoga.ads has 1.2b. Is that the official version?

Wayne

> On Mar 21, 2024, at 12:10 PM, Jeremiah Breeden  
> wrote:
> 
> Wayne,
> 
> I remember this being a thing a while back and it was fixed updated in a 
> later version of Gnoga.  Can you confirm what version of Gnoga you are 
> running?
> 
> On Tue, Mar 12, 2024 at 9:29 AM Wayne Bullaughey via Gnoga-list 
> mailto:gnoga-list@lists.sourceforge.net>> 
> wrote:
> Soon after my application starts a call to Swap_Connection occurs.  Within 60 
> seconds of that I get the following:
> 
> 2024-03-12 08:28:17.87 : Deleting connection - 2
> 2024-03-12 08:28:17.88 : Watchdog error.
> 2024-03-12 08:28:17.88 : raised ADA.ASSERTIONS.ASSERTION_ERROR : Position 
> cursor of Next is bad
> Load address: 0x1027bf000
> Call stack traceback locations:
> 0x102b45091 0x102a1d6e0 0x102a3929b 0x102a3931f 0x102a402d6 0x102b0d008 
> 0x7ff8053f7200
> 
> I prevented this from happening by adding the following lines in the 
> procedure Delete_Connection in the file gnoga-server-connection.adb.
> 
> if Socket_Maps.Key (Current_Socket) = ID then
>   Current_Socket := Socket_Maps.No_Element;
> end if;
> 
> After the line:
> 
> if Socket_Map.Contains (ID) then
> 
> Wayne
> 
> 
> ___
> Gnoga-list mailing list
> Gnoga-list@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/gnoga-list 
> 
> ___
> Gnoga-list mailing list
> Gnoga-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gnoga-list

___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list


Re: [Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d

2024-03-21 Thread Jeremiah Breeden
Wayne,

I remember this being a thing a while back and it was fixed updated in a
later version of Gnoga.  Can you confirm what version of Gnoga you are
running?

On Tue, Mar 12, 2024 at 9:29 AM Wayne Bullaughey via Gnoga-list <
gnoga-list@lists.sourceforge.net> wrote:

> Soon after my application starts a call to Swap_Connection occurs.  Within
> 60 seconds of that I get the following:
>
>
> 2024-03-12 08:28:17.87 : Deleting connection - 2
>
> 2024-03-12 08:28:17.88 : Watchdog error.
>
> 2024-03-12 08:28:17.88 : raised ADA.ASSERTIONS.ASSERTION_ERROR : Position
> cursor of Next is bad
>
> Load address: 0x1027bf000
>
> Call stack traceback locations:
>
> 0x102b45091 0x102a1d6e0 0x102a3929b 0x102a3931f 0x102a402d6 0x102b0d008
> 0x7ff8053f7200
>
>
> I prevented this from happening by adding the following lines in the
> procedure Delete_Connection in the file gnoga-server-connection.adb.
>
>
> if Socket_Maps.Key (Current_Socket) = ID then
>
>   Current_Socket := Socket_Maps.No_Element;
>
> end if;
>
>
> After the line:
>
>
> if Socket_Map.Contains (ID) then
>
>
> Wayne
>
>
> ___
> Gnoga-list mailing list
> Gnoga-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gnoga-list
>
___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list


Re: [Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d

2024-03-12 Thread Wayne Bullaughey via Gnoga-list
Soon after my application starts a call to Swap_Connection occurs.  Within 60 
seconds of that I get the following:

2024-03-12 08:28:17.87 : Deleting connection - 2
2024-03-12 08:28:17.88 : Watchdog error.
2024-03-12 08:28:17.88 : raised ADA.ASSERTIONS.ASSERTION_ERROR : Position 
cursor of Next is bad
Load address: 0x1027bf000
Call stack traceback locations:
0x102b45091 0x102a1d6e0 0x102a3929b 0x102a3931f 0x102a402d6 0x102b0d008 
0x7ff8053f7200

I prevented this from happening by adding the following lines in the procedure 
Delete_Connection in the file gnoga-server-connection.adb.

if Socket_Maps.Key (Current_Socket) = ID then
  Current_Socket := Socket_Maps.No_Element;
end if;

After the line:

if Socket_Map.Contains (ID) then

Wayne


___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list


Re: [Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d

2023-11-28 Thread Jeffrey R. Carter via Gnoga-list
On 28 November 2023 19:56:27 UTC, Blady  wrote:
>
>
>> Le 25 nov. 2023 à 19:58, Jeffrey R. Carter via Gnoga-list 
>>  a écrit :
>> 
>> On 25 November 2023 18:49:46 UTC, Blady  wrote:
>>> 
>>> 
 Le 18 nov. 2023 à 21:26, J Carter  a écrit :
 
> I've upgraded Simple Components in dev_1.8 branch: 
> https://sourceforge.net/p/gnoga/code/ci/dev_1.8/tree/
> I've tested ok with GNAT FSF 13.2 from Alire.
 
 That compiles. Attached is a reproducer, data_error.adb, and corresponding 
 project file (edit the path to gnoga.gpr as needed).
 I've capture the javascript string:
 Array.prototype.join.call (gnoga['g12'].data)
>>> < 
>>> "255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,0,128,0,254,0,128,0,255,0,128,0,255,0,128,0,254,0,0,252,252,0,0,255,255,0,0,255,255,0,0,252,252"
>>> 
>>> The documentation says:
>>> ImageData.data Read only A Uint8ClampedArray representing a one-dimensional 
>>> array containing the data in the RGBA order, with integer values between 0 
>>> and 255 (inclusive). The order goes by rows from the top-left pixel to the 
>>> bottom-right.
>>> (https://developer.mozilla.org/en-US/docs/Web/API/ImageData)
><...>
>> Yes, that's correct. The subprogram that goes the other way also has the 
>> loops in the wrong order.
>
>Hello Jeff,
>
>I've pushed a patch on dev_1.8 branch: 
>https://sourceforge.net/p/gnoga/code/ci/70be52accab63c4866aa8dfba32e759db744a134/
>
>Is it correct for you?
>
>I've also included your reproducer, do you mind?
>
>Regards, Pascal.
>https://blady.pagesperso-orange.fr
>
>

Yes, that looks good. I don't have a problem with including the reproducer, but 
it could use some comments. Also, since you've fixed the problem, Data_Error is 
no longer an appropriate name. 
--
Jeff Carter
"Now go away or I shall taunt you a second time."
Monty Python and the Holy Grail___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list


Re: [Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d

2023-11-28 Thread Blady via Gnoga-list


> Le 25 nov. 2023 à 19:58, Jeffrey R. Carter via Gnoga-list 
>  a écrit :
> 
> On 25 November 2023 18:49:46 UTC, Blady  wrote:
>> 
>> 
>>> Le 18 nov. 2023 à 21:26, J Carter  a écrit :
>>> 
 I've upgraded Simple Components in dev_1.8 branch: 
 https://sourceforge.net/p/gnoga/code/ci/dev_1.8/tree/
 I've tested ok with GNAT FSF 13.2 from Alire.
>>> 
>>> That compiles. Attached is a reproducer, data_error.adb, and corresponding 
>>> project file (edit the path to gnoga.gpr as needed).
>>> I've capture the javascript string:
>>> Array.prototype.join.call (gnoga['g12'].data)
>> < 
>> "255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,0,128,0,254,0,128,0,255,0,128,0,255,0,128,0,254,0,0,252,252,0,0,255,255,0,0,255,255,0,0,252,252"
>> 
>> The documentation says:
>> ImageData.data Read only A Uint8ClampedArray representing a one-dimensional 
>> array containing the data in the RGBA order, with integer values between 0 
>> and 255 (inclusive). The order goes by rows from the top-left pixel to the 
>> bottom-right.
>> (https://developer.mozilla.org/en-US/docs/Web/API/ImageData)
<...>
> Yes, that's correct. The subprogram that goes the other way also has the 
> loops in the wrong order.

Hello Jeff,

I've pushed a patch on dev_1.8 branch: 
https://sourceforge.net/p/gnoga/code/ci/70be52accab63c4866aa8dfba32e759db744a134/

Is it correct for you?

I've also included your reproducer, do you mind?

Regards, Pascal.
https://blady.pagesperso-orange.fr


___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list


Re: [Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d

2023-11-25 Thread Jeffrey R. Carter via Gnoga-list
On 25 November 2023 18:49:46 UTC, Blady  wrote:
>
>
>> Le 18 nov. 2023 à 21:26, J Carter  a écrit :
>> 
>> > I've upgraded Simple Components in dev_1.8 branch: 
>> > https://sourceforge.net/p/gnoga/code/ci/dev_1.8/tree/
>> > I've tested ok with GNAT FSF 13.2 from Alire.
>> 
>> That compiles. Attached is a reproducer, data_error.adb, and corresponding 
>> project file (edit the path to gnoga.gpr as needed).
>> 
>> The Log call outputs
>> 
>> 2023-11-18 21:03:10.59 :  4 3
>> 
>> (timestamp will vary), showing that the first dimension of a Pixel_Data_Type 
>> is X/columns, and the 2nd is Y/rows, since the image is 4 wide and 3 high.
>> 
>> The resulting PPM file contains
>> 
>> P3
>>  4 3 255
>>  255 0 0 255 0 0 0 128 0 0 0 255
>>  255 0 0 0 128 0 0 128 0 0 0 255
>>  255 0 0 0 128 0 0 0 255 0 0 255
>> 
>> which is not what was drawn in the image.
>
>Hello Jeff,
>
>I've capture the javascript string:
>> Array.prototype.join.call (gnoga['g12'].data)
>< 
>"255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,0,128,0,254,0,128,0,255,0,128,0,255,0,128,0,254,0,0,252,252,0,0,255,255,0,0,255,255,0,0,252,252"
>
>The documentation says:
>ImageData.data Read only A Uint8ClampedArray representing a one-dimensional 
>array containing the data in the RGBA order, with integer values between 0 and 
>255 (inclusive). The order goes by rows from the top-left pixel to the 
>bottom-right.
>(https://developer.mozilla.org/en-US/docs/Web/API/ImageData)
>
>If my understanding is correct, this confirms your point, doesn't it?
>Gnoga String_To_Pixel_Data loops order isn't correct.
>
>Regards, Pascal.
>https://blady.pagesperso-orange.fr
>
>

Yes, that's correct. The subprogram that goes the other way also has the loops 
in the wrong order. 
--
Jeff Carter
"Now go away or I shall taunt you a second time."
Monty Python and the Holy Grail___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list


Re: [Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d

2023-11-25 Thread Blady via Gnoga-list


> Le 18 nov. 2023 à 21:26, J Carter  a écrit :
> 
> > I've upgraded Simple Components in dev_1.8 branch: 
> > https://sourceforge.net/p/gnoga/code/ci/dev_1.8/tree/
> > I've tested ok with GNAT FSF 13.2 from Alire.
> 
> That compiles. Attached is a reproducer, data_error.adb, and corresponding 
> project file (edit the path to gnoga.gpr as needed).
> 
> The Log call outputs
> 
> 2023-11-18 21:03:10.59 :  4 3
> 
> (timestamp will vary), showing that the first dimension of a Pixel_Data_Type 
> is X/columns, and the 2nd is Y/rows, since the image is 4 wide and 3 high.
> 
> The resulting PPM file contains
> 
> P3
>  4 3 255
>  255 0 0 255 0 0 0 128 0 0 0 255
>  255 0 0 0 128 0 0 128 0 0 0 255
>  255 0 0 0 128 0 0 0 255 0 0 255
> 
> which is not what was drawn in the image.

Hello Jeff,

I've capture the javascript string:
> Array.prototype.join.call (gnoga['g12'].data)
< 
"255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,0,128,0,254,0,128,0,255,0,128,0,255,0,128,0,254,0,0,252,252,0,0,255,255,0,0,255,255,0,0,252,252"

The documentation says:
ImageData.data Read only A Uint8ClampedArray representing a one-dimensional 
array containing the data in the RGBA order, with integer values between 0 and 
255 (inclusive). The order goes by rows from the top-left pixel to the 
bottom-right.
(https://developer.mozilla.org/en-US/docs/Web/API/ImageData)

If my understanding is correct, this confirms your point, doesn't it?
Gnoga String_To_Pixel_Data loops order isn't correct.

Regards, Pascal.
https://blady.pagesperso-orange.fr




___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list


Re: [Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d

2023-11-18 Thread J Carter via Gnoga-list
> I've upgraded Simple Components in dev_1.8 branch: 
> https://sourceforge.net/p/gnoga/code/ci/dev_1.8/tree/
> I've tested ok with GNAT FSF 13.2 from Alire.
That compiles. Attached is a reproducer, data_error.adb, and corresponding 
project file (edit the path to gnoga.gpr as needed).
The Log call outputs
2023-11-18 21:03:10.59 :  4 3
(timestamp will vary), showing that the first dimension of a Pixel_Data_Type is 
X/columns, and the 2nd is Y/rows, since the image is 4 wide and 3 high.
The resulting PPM file contains
P3 4 3 255 255 0 0 255 0 0 0 128 0 0 0 255 255 0 0 0 128 0 0 128 0 0 0 255 255 
0 0 0 128 0 0 0 255 0 0 255
which is not what was drawn in the image.
--Jeff Carter"Now go away or I shall taunt you a second time."Monty Python and 
the Holy Gral 

On Saturday, November 18, 2023 at 10:04:14 AM GMT+1, Blady 
 wrote:  
 
 
> Le 17 nov. 2023 à 15:03, J Carter  a écrit :
> 
> > But maybe the two same errors in both code cancel each other out.
> 
> Yes, they would.
> 
> > Could you please give a reproducer?
> 
> Maybe not. I realized I hadn't pulled for a while, so I did a pull and now 
> "make all" has errors with the Simple Components. The first I saw was fixed 
> long ago, before GNAT 13 was released, IIRC: In 
> deps/simple_components/atomic-access/ada/gnat-sockets-server.adb, procedure 
> Do_Connect, 'Unchecked_Access needs to be changed to 'Unrestricted_Access. If 
> I fix that, then there are other errors that are not so obvious. It's as if 
> it's a much earlier version of the Simple Components. But that is another 
> issue.

I've upgraded Simple Components in dev_1.8 branch: 
https://sourceforge.net/p/gnoga/code/ci/dev_1.8/tree/
I've tested ok with GNAT FSF 13.2 from Alire.

Pascal.
https://blady.pagesperso-orange.fr


  with Ada.Text_IO;
with Gnoga.Application.Singleton;
with Gnoga.Gui.Element.Canvas.Context_2D;
with Gnoga.Gui.View;
with Gnoga.Gui.Window;
with Gnoga.Types.Colors;

procedure Data_Error is
   procedure Write_P3 (File_Name : in String; Image : in Gnoga.Types.Pixel_Data_Type) with
  Pre => Image'First (1) = 1 and Image'First (2) = 1;

   procedure Write_P3 (File_Name : in String; Image : in Gnoga.Types.Pixel_Data_Type) is
  Output : Ada.Text_IO.File_Type;
   begin -- Write_P3
  Ada.Text_IO.Create (File => Output, Name => File_Name);
  Ada.Text_IO.Put_Line (File => Output, Item => "P3");
  Ada.Text_IO.Put_Line
 (File => Output, Item => Integer'Image (Image'Length (1) ) & Integer'Image (Image'Length (2) ) & " 255");

  All_Rows : for Y in Image'Range (2) loop
 All_Columns : for X in Image'Range (1) loop
Ada.Text_IO.Put
   (File => Output, Item => Image (X, Y).Red'Image & Image (X, Y).Green'Image & Image (X, Y).Blue'Image);
 end loop All_Columns;

 Ada.Text_IO.New_Line (File => Output);
  end loop All_Rows;

  Ada.Text_IO.Close (File => Output);
   end Write_P3;

   Width  : constant := 4;
   Height : constant := 3;

   Window  : Gnoga.Gui.Window.Window_Type;
   View: Gnoga.Gui.View.View_Type;
   Canvas  : Gnoga.Gui.Element.Canvas.Canvas_Type;
   Context : Gnoga.Gui.Element.Canvas.Context_2D.Context_2D_Type;
   Image   : Gnoga.Gui.Element.Canvas.Context_2D.Image_Data_Type;
begin -- Data_Error
   Gnoga.Application.Title (Name => "Demonstrate error in Data");
   Gnoga.Application.HTML_On_Close (HTML => "Data_Error ended.");
   Gnoga.Application.Open_URL;
   Gnoga.Application.Singleton.Initialize (Main_Window => Window);
   View.Create (Parent => Window);
   View.Text_Alignment (Value => Gnoga.Gui.Element.Center);
   Canvas.Create (Parent => View, Width => Width, Height => Height);
   Context.Get_Drawing_Context_2D (Canvas => Canvas);

   Red : for X in 0 .. Width - 1 loop
  Context.Pixel (X => X, Y => 0, Color => Gnoga.Types.Colors.Red);
   end loop Red;

   Green : for X in 0 .. Width - 1 loop
  Context.Pixel (X => X, Y => 1, Color => Gnoga.Types.Colors.Green);
   end loop Green;

   Blue : for X in 0 .. Width - 1 loop
  Context.Pixel (X => X, Y => 2, Color => Gnoga.Types.Colors.Blue);
   end loop Blue;

   delay 0.5;

   Context.Get_Image_Data (Image_Data => Image, Left => 0, Top => 0, Width => 4, Height => 3);

   Get_Data : declare
  Pixel : constant Gnoga.Types.Pixel_Data_Type := Image.Data;
   begin -- Get_Data
  Gnoga.Log (Message => Integer'Image (Pixel'Length (1) ) & Integer'Image (Pixel'Length (2) ) );
  Write_P3 (File_Name => "data_error.ppm", Image => Pixel);
   end Get_Data;

   delay 4.5;

   Gnoga.Application.Singleton.End_Application;
end Data_Error;


data_error.gpr
Description: Binary data
___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list


Re: [Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d

2023-11-18 Thread Blady via Gnoga-list

> Le 17 nov. 2023 à 15:03, J Carter  a écrit :
> 
> > But maybe the two same errors in both code cancel each other out.
> 
> Yes, they would.
> 
> > Could you please give a reproducer?
> 
> Maybe not. I realized I hadn't pulled for a while, so I did a pull and now 
> "make all" has errors with the Simple Components. The first I saw was fixed 
> long ago, before GNAT 13 was released, IIRC: In 
> deps/simple_components/atomic-access/ada/gnat-sockets-server.adb, procedure 
> Do_Connect, 'Unchecked_Access needs to be changed to 'Unrestricted_Access. If 
> I fix that, then there are other errors that are not so obvious. It's as if 
> it's a much earlier version of the Simple Components. But that is another 
> issue.

I've upgraded Simple Components in dev_1.8 branch: 
https://sourceforge.net/p/gnoga/code/ci/dev_1.8/tree/
I've tested ok with GNAT FSF 13.2 from Alire.

Pascal.
https://blady.pagesperso-orange.fr




___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list


Re: [Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d

2023-11-17 Thread J Carter via Gnoga-list
> But maybe the two same errors in both code cancel each other out.
Yes, they would.
> Could you please give a reproducer?
Maybe not. I realized I hadn't pulled for a while, so I did a pull and now 
"make all" has errors with the Simple Components. The first I saw was fixed 
long ago, before GNAT 13 was released, IIRC: In 
deps/simple_components/atomic-access/ada/gnat-sockets-server.adb, procedure 
Do_Connect, 'Unchecked_Access needs to be changed to 'Unrestricted_Access. If I 
fix that, then there are other errors that are not so obvious. It's as if it's 
a much earlier version of the Simple Components. But that is another issue.
I'll look into seeing if I can compile 2.1a and use it to make a reproducer. 
But basically, I obtained a Pixel_Data_Type from a Canvas/Context and then 
wrote a BMP file of the image. The resulting image was garbled. For a 
sufficiently small image you could write a P3 PPM file more easily if you want 
to try it out. 

All this is based on the usage of X and Y as indices into a Pixel_Data_Type in 
procedure Data (Image_Data_Type; Pixel_Data_Type) and function 
String_To_Pixel_Data, where you find D (X, Y), for example. There's no 
indication in the spec of Gnoga.Types of the meaning of the two dimensions, but 
there should be.

--Jeff Carter"Now go away or I shall taunt you a second time."Monty Python and 
the Holy Gral 

On Thursday, November 16, 2023 at 10:25:39 PM GMT+1, Blady 
 wrote:  
 
 Hello Jeff,

> Le 14 nov. 2023 à 18:35, Jeffrey R. Carter via Gnoga-list 
>  a écrit :
> 
> Comments ts based on the 1.7 branch.
> 
> There appears to be an error in function String_To_Pixel_Data, based on the 
> string returned from function Data (Image_Data_Type) return String: the Y 
> loop needs to be the outer loop.

Well, one chance out of two to be ... wrong.
However, I recall having tested the Data procedure and function against 
Javascript in canva_test.adb.
But maybe the two same errors in both code cancel each other out.
Could you please give a reproducer?

> In addition, the 4 function calls in the aggregate rely on the order of 
> evaluation, which is not specified by the language. While GNAT is unlikely to 
> change this, it's safer to assign the results of the calls to variables and 
> use them in the aggregate. 
> 
> Finally, the initialization of S has no effect. 

Yes it's typical coding style of David.
I guess it isn't the only one in Gnoga.
You know Ada better than me but I wonder what was David motivation.

> Assuming that the string supplied to procedure Data (Image_Data_Type; String) 
> has the same format, then the change to the loops also applies to procedure 
> Data (Image_Data_Type; Pixel_Data_Type).

Sure.

Regards, Pascal.
https://blady.pagesperso-orange.fr


  ___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list


Re: [Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d

2023-11-16 Thread Blady via Gnoga-list
Hello Jeff,

> Le 14 nov. 2023 à 18:35, Jeffrey R. Carter via Gnoga-list 
>  a écrit :
> 
> Comments ts based on the 1.7 branch.
> 
> There appears to be an error in function String_To_Pixel_Data, based on the 
> string returned from function Data (Image_Data_Type) return String: the Y 
> loop needs to be the outer loop.

Well, one chance out of two to be ... wrong.
However, I recall having tested the Data procedure and function against 
Javascript in canva_test.adb.
But maybe the two same errors in both code cancel each other out.
Could you please give a reproducer?

> In addition, the 4 function calls in the aggregate rely on the order of 
> evaluation, which is not specified by the language. While GNAT is unlikely to 
> change this, it's safer to assign the results of the calls to variables and 
> use them in the aggregate. 
> 
> Finally, the initialization of S has no effect. 

Yes it's typical coding style of David.
I guess it isn't the only one in Gnoga.
You know Ada better than me but I wonder what was David motivation.

> Assuming that the string supplied to procedure Data (Image_Data_Type; String) 
> has the same format, then the change to the loops also applies to procedure 
> Data (Image_Data_Type; Pixel_Data_Type).

Sure.

Regards, Pascal.
https://blady.pagesperso-orange.fr




___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list


[Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d

2023-11-14 Thread Jeffrey R. Carter via Gnoga-list
Comments ts based on the 1.7 branch.

There appears to be an error in function String_To_Pixel_Data, based on the 
string returned from function Data (Image_Data_Type) return String: the Y loop 
needs to be the outer loop.

In addition, the 4 function calls in the aggregate rely on the order of 
evaluation, which is not specified by the language. While GNAT is unlikely to 
change this, it's safer to assign the results of the calls to variables and use 
them in the aggregate. 

Finally, the initialization of S has no effect. 

Assuming that the string supplied to procedure Data (Image_Data_Type; String) 
has the same format, then the change to the loops also applies to procedure 
Data (Image_Data_Type; Pixel_Data_Type).
--
Jeff Carter
"Now go away or I shall taunt you a second time."
Monty Python and the Holy Grail___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list