[PLUGIN] Canvas

Post your completed addons to share with the community

Post » Fri Sep 06, 2013 9:17 pm

@tulamide

I'm not real surprised browsers can be somewhat picky, and random goes all the way to the 14th space, which does seem a little excessive.

Honestly you should just be happy you can get away with not having to add a str() on there as well. heh
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sat Sep 07, 2013 3:46 am

@newt


Serious, I do agree as far as I'm concerned. I certainly don't care much if I use random() or int(random()). It's the plugin showing different behaviors for the same issue that I wanted to point out. From a programmer's point of view, so to say. A consistent behavior can help much tracking down possible issues. I hope that I didn't instead leave the impression of being picky
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sat Sep 07, 2013 3:53 am

picky
B
12
S
3
G
1
Posts: 347
Reputation: 2,866

Post » Sat Sep 07, 2013 4:25 am

[QUOTE=ghost] picky[/QUOTE]
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sat Sep 07, 2013 6:16 am

@tulamide

I wouldn't say you are being overly picky, Rgb should accept decimals, in fact the alpha channel goes from 0 to 1.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sat Sep 07, 2013 6:36 am

@clrammer
It is something that would have to be fixed on the plugin side.

@tulamide
That's not picky at all. I fully agree its ideal to have consistency. I'll shoot for the default behavior for an invalid color to use black instead as this is what html5 does. Gradient and fill should handle colors the same way. I'll have to see why gradient causes an error. Flood fill is a bit different as internally it uses numbers instead of a string. I should be able to fix that. Also thanks for pointing out the typo with horizontal.

I'll try to get an update out sometime this week. Keep up with the bug reports and feature requests.

@newt
Actually the HTML colors only take integers for rgb colors even though alpha is a float. Right now the colors are passed as is. I'd prefer not to have to do analysis on the string if I can before passing it.
B
79
S
24
G
53
Posts: 4,731
Reputation: 40,225

Post » Sat Sep 07, 2013 6:50 am

@R0J0hound

I understand completely, especially after all that trouble I gave you with Firefox reading pixels wrong.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sat Sep 07, 2013 7:18 pm

Thanks for still updating this.

I just noticed another thing relating WebGL performance in Windows.

In native Chrome the performance for me is great, with 250 fps with vsync disabled and 60 fps when enabled. Almost no performance hit when drawing to canvas every tick. In both Node-Webkit and Firefox, however, the frame rate drops to around 30 fps.

I wouldn't be surprised if Firefox did something different, but I wonder why the performance is so much worse in Node-Webkit compared to Chrome, as it supposedly uses the same render engine.

After the latest update, this only happens when clearing/updating the canvas (which I unfortunately do every tick). The performance is better with WebGL off, so it seems related to WebGL.

Any ideas what's causing this? Could it be related to the original WebGL issue?SirSpunky2013-09-07 19:39:17
B
18
S
3
Posts: 57
Reputation: 1,081

Post » Sat Sep 07, 2013 8:22 pm

[QUOTE=SirSpunky]
I wouldn't be surprised if Firefox did something different, but I wonder why the performance is so much worse in Node-Webkit compared to Chrome, as it supposedly uses the same render engine.[/QUOTE]
it seems chrome dropped webkit and uses their own engine, `blink` or `binge`, something like that.
B
12
S
3
G
1
Posts: 347
Reputation: 2,866

Post » Sat Sep 07, 2013 8:35 pm

@SirSpunky
It is most likely the webgl issue. If the performance is high then canvas2d isn't being used. If performance is low then webgl is being used. Different browsers have decide differently whether or not to use webgl or canvas2d depending on your graphics card. Node-webkit tries to force webgl to be enabled which may differ from what chrome usually does.

In other news... A NEW RELEASE. Download on first post.
[change] New icon thanks to paradox.
[fix] Invalid colors would break "gradient fill" and "flood fill".
- The default behavior when using a invalid color is black is used.
[add] Added expressions to get individual components from colors: red,blue,green, alpha.
[fix] A typo fix and a few other fixes that I don't recall.
B
79
S
24
G
53
Posts: 4,731
Reputation: 40,225

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests