<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">I think it could be useful to rename klayer to KArea or KZone, an object<br>
that gives u easy access to the canvas and context. <br></blockquote>I like the objective, but I dislike the name. <br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
I think it could be useful to rename klayer to KArea or KZone, an object<br>
that gives u easy access to the canvas and context. We would also need<br>
this object later when we try to save its image state, i.e. save what<br>
has been drawn so we can come back they don't lose everything that has<br>
happened on the canvas. I am talking about save() and restore() in a<br>
more complex and powerful way than ctx.save() or ctx.restore(), which<br>
only save the drawing state.<br></blockquote>
I think, you're referring to "saving" like taking a canvas snapshot and "restoring" it, rigth?<br><br><div class="gmail_quote">2009/9/3 Bryan Berry <span dir="ltr"><<a href="mailto:bryan@olenepal.org" target="_blank">bryan@olenepal.org</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
also another issue i have is that I can't attach a kbutton to a specific<br>
context. I hacked it by adding the event listener directly to the canvas<br>
element.<br>
<br>
I think it could be useful to rename klayer to KArea or KZone, an object<br>
that gives u easy access to the canvas and context. We would also need<br>
this object later when we try to save its image state, i.e. save what<br>
has been drawn so we can come back they don't lose everything that has<br>
happened on the canvas. I am talking about save() and restore() in a<br>
more complex and powerful way than ctx.save() or ctx.restore(), which<br>
only save the drawing state.<br>
<br>
also, with KArea or KZone, we could use that object to move the html<br>
element around, be shrink it, reposition it on the page.<br>
<div><div></div><div><br>
On Thu, 2009-09-03 at 17:56 +0545, Bryan Berry wrote:<br>
> I have adding_up kind of working w/ the new html layout, but it doesn't<br>
> actually add up to the correct sum :(<br>
><br>
> Problem #1<br>
><br>
> I kept getting an infinite loop in this section in the distance2() call<br>
><br>
> I have to admit I don't exactly understand what distance2 is doing<br>
> <a href="http://git.sugarlabs.org/projects/karma/repos/mainline/blobs/multicanvas/examples/adding_up_to_10/js/lesson.js#line142" target="_blank">http://git.sugarlabs.org/projects/karma/repos/mainline/blobs/multicanvas/examples/adding_up_to_10/js/lesson.js#line142</a><br>
><br>
> for ( var j=0; j<pos.length; j++) {<br>
> if ( k.geometry.distance2( pos[j], {"x": x, "y": y} ) < 80 ) { flag<br>
> = true;<br>
> break; } }<br>
> }while ( flag === true );<br>
> pos.push( { "x":x, "y": y } );<br>
> k.library.images[ imgId ].draw(ctx, x, y )}<br>
><br>
> Also, i don't understand how u can call distance2 w/ pos[j] when pos is<br>
> still an empty array. Maybe it is because js just does a lot of weird<br>
> stuff.<br>
><br>
> Problem #2<br>
><br>
> None of the answer boxes holds the correct sum :(<br>
><br>
> I am not sure where the logic error is but I am hunting for it!<br>
><br>
> as we discussed yesterday, i have put all this work on the "multicanvas"<br>
> tree.<br>
> <a href="http://git.sugarlabs.org/projects/karma/repos/mainline/trees/multicanvas" target="_blank">http://git.sugarlabs.org/projects/karma/repos/mainline/trees/multicanvas</a><br>
><br>
><br>
--<br>
Bryan W. Berry<br>
Technology Director<br>
OLE Nepal, <a href="http://www.olenepal.org" target="_blank">http://www.olenepal.org</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Felipe López Toledo<br>