<Hunar>
finally :) I downloaded it with another peogram instead of chrome, now its 03
<abu[m]>
Great! Yeah, Chrome is obscure with its downloads. It creates new versions of the file each time ☺
<Hunar>
I still have the canvas problem :/ it's like nothing changed .. and if I only put the update commands in (unless F) then the problem is worse .. returning anything back except NIL causes problems
<Hunar>
That has a new problem, when I move my finger over the canvas the animation stops, slows down such that it updates every 5 seconds .. If I move my finger more then the refresh rate becomes evern more slow
<abu[m]>
Uh, strange!
<abu[m]>
Can you (trace 'drawCanvas) in your version to see if 'T' is passen upon touch events?
hrberg has joined #picolisp
<abu[m]>
I just tried https://picolisp.com/canvas on Chrome in Android, and all touches are perfectly ignored
<abu[m]>
Are you sure you cleared the cache in every involved browser?
<abu[m]>
Now I tested your code too. Works perfectly!
<abu[m]>
You could also install "chess" on PilBox, should be best
<Hunar>
I have it :)
<abu[m]>
☺
<Hunar>
What should we do about the canvas problem .. my bouncing ball program didn't improve with the update :( do you have more ideas
<Hunar>
On desktop, updated queue and slow down the animation, on PilBox they speed up like yesterday
<Hunar>
updates*
<abu[m]>
If you run bouncing ball locally, and touch the canvas, it gets confused?
<abu[m]>
With the version I posted above, it works very fine
<abu[m]>
Only if I work around heavily for a few seconds, it stops for a moment, I think because of overload
<abu[m]>
But touches or short scrolls have no effect
<abu[m]>
I have to stirr several seconds to see anything
<abu[m]>
And after that it continues normally
<Hunar>
Hmm, I didn't notice that, it does become normal again after I let go.. but the drawCanvas calls are being called far too much, can I manually clear it? I just tried moving the mouse far too much and the cpu usage got very high and the animation didn't recover this time
<Hunar>
It's a memory leak that will bite me in the future, I plan to make interactive canvas programs
<abu[m]>
For the little bouncing ball?
<abu[m]>
And why a memory leak?
<Hunar>
Yes, after click&dragging for a minute, the process for pil was constantly consuming %1 cpu and the ball was updating like every 4 seconds
<Hunar>
after I released the mouse
<abu[m]>
and the memory size?
<Hunar>
The task manager was saying %0 memory the whole time
<Hunar>
let me check the bytes
<abu[m]>
I mean, it draws only 2 rects. A handfull of bytes being transferred
seninha has joined #picolisp
<Hunar>
the task manager I'm using is very confusing and basic, I don't know where the memory is :/
<Hunar>
yeah, but it still was slowed down :(
<abu[m]>
0% memory means the memory of the whole PC is exhausted? ;)
<Hunar>
This is after like 80 seconds of dragging and clicking .. then waited for a while and didn't get better .. as you see in the video it's glitching sometimes
<abu[m]>
Hard to see
<abu[m]>
I have no desktop atm
<abu[m]>
But anyway, I have no idea
<abu[m]>
I think I can reproduce what you mean with picolisp.com/canvas
<abu[m]>
I'm walking in the fields and have only mobile network
<abu[m]>
Then if I make it "Faster" and faster, and then swipe around heavily, it slows down noticibly
<abu[m]>
This cannot be avoided I think
<abu[m]>
If there is more traffic than the connection can handle, it slows down
<abu[m]>
I can achieve maximally around 10 Hz here
<abu[m]>
The same on localhost (Termux/Phone) it goes up to 50 Hz
<abu[m]>
So I think this is what you mean
<abu[m]>
The question is if that can be avoided
<abu[m]>
Throw away updates? Which ones, and, most of all, how?
<abu[m]>
The other question is, why would you want do drag around?
<abu[m]>
I tested yesterday only mouse clicks and mouse-leave
<abu[m]>
producing almost zero data compared to dragging
<Hunar>
Yes, I'm expecting an update each frame
<Hunar>
If i click then the next frame I'm expecting 2 updates one for the click, but no further updates the following frames
<Hunar>
currently anything you do will be an update for the rest of time each frame
<abu[m]>
You can check 'F' for le0
<abu[m]>
and then send nothing
<abu[m]>
0 is start, and -1 is drag
<abu[m]>
If you want to drag something, call (csDef "someName") to save the canvas
<abu[m]>
Then on each update call (csDraw "someName") plus the desired components
<abu[m]>
This makes drawing parts of the screen very fast
<abu[m]>
The chess program uses this to move peaces by dragging
<abu[m]>
To ignore all touch events, put the 'make' also inside the 'F' check
<abu[m]>
or do (unless F (change the state)) (when (gt0 F) (make ...)) to ignore only drag events
<Hunar>
Here is the detailed information of what I consider the problem http://ix.io/49xu
<abu[m]>
I see, there is some useless echoing
<abu[m]>
You mean the events with "1", right?
<abu[m]>
They happen only upon overrun?
<abu[m]>
Because normally clicks work fine
<abu[m]>
Or, not overrun, but during auto-repeat, right?
<Hunar>
It happens forever, I click once but it keeps echoing forever
<abu[m]>
(I use clicks in several applications, and they work exactly as needed, but never used them in auto-repeating canvasses)
<abu[m]>
So this is a bug in the repeating
<abu[m]>
It sends the wrong flag
<Hunar>
Yes, I'm assuming that this causes the slowing down of the animation, since I make aloot of clicks and drags
<abu[m]>
I think the slow down will also happen with another flag. A click is not the problem, only the drag I think
<abu[m]>
The relevant line is 196 in @lib/canvas.js I think
<abu[m]>
It passes along the flag it received
<abu[m]>
What if you remove ", flg" again?
<abu[m]>
This is how it was before yesterday
<Hunar>
I don't know, maybe I try it tomorrow, currently I'm very busy my head hurts
<abu[m]>
ok
<abu[m]>
I see no -1 (i.e. drag in your logs)
<Hunar>
Drag would create sooo many logs that I don't know which is which
<abu[m]>
yeah
<abu[m]>
In any case, the 1 may be wrong, but I think it will not change the total number of drawings
<abu[m]>
Basic question: Do you really need an auto-repeat?
<abu[m]>
I never had a real app that needed it
<abu[m]>
Normally you draw if you have data
<Hunar>
Sorry, what is auto-repeat exactly .. I don't think I used auto-repeat
<abu[m]>
It is a positive Dly
<abu[m]>
1000 in the bouncing ball
<abu[m]>
So the canvas repeats every second
<abu[m]>
For example, the chess program redraws when data are available
<abu[m]>
e.g. after a move is done, perhaps after an hour ;)
<abu[m]>
It would be a huge waste to draw all the time
<Hunar>
Aha, then yes I do .. I use auto-repeat for simple games :) or maybe complex in the future .. I need moving things on the screen
<abu[m]>
Yes, but move when necessary, not all the time
<abu[m]>
Still, the "1" may be wrong, it is complicated
<Hunar>
It should be waste to draw all the time, but not un-nessesarly wasefull, just waste enough :)
<abu[m]>
So there may be a bug in auto-repeat
<abu[m]>
passing the wrong flg
<Hunar>
When I finish click or drag etc.. and not touching anything, I want drawCanvas to only be called once each frame.. that is all my problem :)
<abu[m]>
There is no end-drag. While dragging, it needs to call drawCanvas to send the -1 flag
<abu[m]>
Click sends "1" only once. It may be a bug that auto-repeat resends it as I said
<abu[m]>
I will debug this
<Hunar>
:) my head is full, I'll go now
<Hunar>
good bye
<abu[m]>
☺
seninha has quit [Quit: Leaving]
seninha has joined #picolisp
<abu[m]>
Released another @lib/canvas.js
<abu[m]>
Hope I improved the protocol
<abu[m]>
My stuff seems to work so far
seninha has quit [Ping timeout: 240 seconds]
seninha has joined #picolisp
mario-goulart has quit [Remote host closed the connection]