01:45
<csarven>
Is there a way for a browser to grab the contents at a URI fragment identifier? I was hoping to use <object data="http://example.org/#foo">; however, the browser seems to only treat the URI excluding the fragment
15:22
<jacobolus>
using the canvas API, is there any way to make an arbitrary shape via a bunch of transformations, but then have the stroke transform/scale be relative to pixels?
15:23
<jacobolus>
e.g. if I want to stroke an oval with a 5px wide outline, it'd be nice if the line could have uniform thickness
15:24
<jacobolus>
instead of the stroke getting distorted along with the shape
15:25
<tomasf>
not afaik. you'd have to scale the line width yourself to compensate. 1/transformScale, I guess
15:26
<Philip`>
You could set up the transform, draw the shape, apply the inverse transform, then stroke it, I think
15:26
<zewt>
tomasf: doesn't help if you have a non-1:1 scale on the object you're drawing and then that scale applies to the stroke as well, i think
15:26
<tomasf>
zewt: yep
15:35
<zewt>
just resetting the transform to identity seems to work: http://zewt.org/~glenn/stroke.html
15:35
<zewt>
simpler version of what philip said, i think
15:41
<jacobolus>
Philip`: I tried doing setTransform(1, 0, 0, 0, 1, 0) and that seemed to make the whole thing stop working
15:41
<jacobolus>
zewt: oh, hmm
15:41
<jacobolus>
maybe I just put a typo in someplace or something
15:41
<zewt>
1,0,0,1,0,0, not 1,0,0,0,1,0
15:42
<zewt>
the argument order for that function is odd
15:42
<zewt>
(column-major, rather unintuitive)
15:43
<jacobolus>
oh, I see
15:43
<jacobolus>
that is weird
15:43
<zewt>
i take it stroke is really just transforming the line width by the transform to figure out the resulting width and then doing the actual operation in screen coordinates
15:43
<jacobolus>
I'm somewhat annoyed that these don't let people use a 3x3 matrix, but that ship has sailed I guess :)
15:44
<zewt>
it wouldn't have, if it was row-major :)
15:45
<jacobolus>
heh
15:45
<zewt>
two ships that sailed together
15:45
<jacobolus>
maybe they could just order it M00, M10, M20, M21, M11, M01, M02, M12, M22, for maximal confusion
15:46
<jacobolus>
"snake order"
15:47
<jacobolus>
great, that seems to work
15:47
<jacobolus>
zewt: thanks
15:47
<jacobolus>
Philip`, tomasf: thanks to you too :)
15:49
<jacobolus>
so now I have something like http://pastie.textmate.org/private/wgeqzabrzkghnsphwydsa
15:50
<Philip`>
zewt: It's not just multiplying the line width - you can have non-uniform scales or skews that affect the stroke
15:50
<zewt>
i don't even know what language this is, heh
15:50
<jacobolus>
zewt: coffeescript
15:50
<jacobolus>
:)
15:50
<zewt>
"obscure fadscript" :)
15:51
<jacobolus>
zewt: output, http://pastie.textmate.org/private/g09sud4d8ewurqptyialuq
15:51
<jacobolus>
zewt: less and less obscure all the time, and in my (few weeks) experience, a joy to work with
16:02
<jacobolus>
that the path shape is set according to the original transformation but the stroke distorted by the stroke-time transformation allows some interesting stuff
16:03
<jacobolus>
for example, in conjunction with round joins and line ends, can be used to have the stroke shape be an arbitrary ellipse
16:03
<jacobolus>
"caligraphic" style
16:04
<jacobolus>
er, *calligraphic
16:07
<jacobolus>
is all the "focus management' stuff in the canvas 2d context spec implemented widely?
16:07
<Ms2ger>
Not at all
16:07
<jacobolus>
one of those "someday" things?
16:08
<Ms2ger>
I hear there's an HTMLWG decision upcoming about it
16:11
<smaug____>
focus management in canvas?
16:11
<smaug____>
or a11y?
16:11
<jacobolus>
smaug____: http://dev.w3.org/html5/2dcontext/#focus-management
16:11
<jacobolus>
oh
16:11
<smaug____>
oh, huh. yet more to review
16:12
<jacobolus>
trying to draw focus rings in canvas seems like somewhat silly idea to me
16:13
<zewt>
yeah, it's not like native focus styles apply to curves, and many of them aren't simply dotted lines around objects like links
16:14
<zewt>
giving UA some control over it isn't a bad idea, but i doubt there's much it could actually do other than pick a stroke style
16:15
<smaug____>
drawFocusRing looks pretty useless to me
16:15
<zewt>
heard something about that being simplified, but i havn't been following canvas stuff
16:16
<jacobolus>
Hixie: by the way, CIECAM02 implementation https://github.com/jrus/chromatist
17:25
<AryehGregor>
There is a link on a page to a PDF I want to read, but it goes to http://10.58.170.5/.
17:25
<AryehGregor>
I mean, seriously?
17:26
<AryehGregor>
This is a public website: http://www1.cbs.gov.il/reader/?MIval=cw_usr_view_SHTML&ID=576
17:27
AryehGregor
guesses the correct URL from nearby URLs
17:42
<zewt>
the "worksforme" testing methodology
17:45
<Philip`>
I like how pressing shift+down several times in Opera on a Google search results page causes it to select the Google logo image, and then to begin scrolling down within the image so you see a load of random icons in its place
17:46
Philip`
wonders if there will ever be non-hacky ways to do spriting
17:46
<zewt>
"no hacks to see here, folks"
23:26
<jacobolus>
is there a good way to clear a <canvas> without altering its context?
23:28
<jacobolus>
I guess I can do something like save context, zero out transform, clearRect the whole width/height, restore context
23:30
<bga_>
canvas.width = canvas.width
23:31
<jacobolus>
bga_: that kills my context
23:31
<bga_>
dirty hack by @kangax
23:31
<jacobolus>
bga_: I don't think I can do a save/restore around that can I?
23:31
<jacobolus>
I guess I can try and see
23:32
<jacobolus>
also, no longer too much a "dirty hack" when it's widely documented as the right way to do it :)
23:33
<bga_>
jacobolus gc do not kills your context => you will not lost it
23:33
<bga_>
i guess
23:33
<jacobolus>
I'm not sure what you mean
23:34
<bga_>
gc == garbage collector
23:34
<jacobolus>
if I do canvas.width = canvas.width, at least in Safari, my transform matrix is reset to the identity
23:34
<bga_>
heh
23:35
<jacobolus>
I can't save/restore around it either
23:35
<jacobolus>
so I'm going to try my way
23:35
<jacobolus>
:)
23:36
<bga_>
but you can get second clear context :)
23:36
<bga_>
may be its faster way
23:36
<jacobolus>
hm?
23:36
<jacobolus>
not sure what you mean
23:37
<jacobolus>
I have a context stack that I don't want to destroy, I just want to clear the whole canvas image
23:37
<bga_>
one canvas can have multi contexes
23:37
<bga_>
with different states
23:38
<bga_>
and types(2в/3d)
23:38
<jacobolus>
I can have multiple 2d contexts on a canvas?
23:38
<bga_>
*2d
23:38
<bga_>
yeah
23:38
<jacobolus>
how does that work?
23:39
<jacobolus>
I don't see any mechanism in the spec for switching contexts
23:39
<bga_>
sec
23:41
<bga_>
oh
23:41
<bga_>
fail in chome
23:41
<bga_>
context is singleton :(
23:42
<bga_>
soкry
23:42
<bga_>
*sorry
23:45
<bga_>
jacobolus another way to avoid save/restore state is do `clearRect` with infinite bounds %)