<br><br><div class="gmail_quote">On Fri, Jul 4, 2008 at 2:16 PM, Igor Stasenko <<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">2008/7/4 Michael van der Gulik <<a href="mailto:mikevdg@gmail.com">mikevdg@gmail.com</a>>:<br>
</div><div class="Ih2E3d"><br>
> What I was considering doing was making the Canvas the source of events.<br>
> Every Canvas has a model which must implement event handling methods and a<br>
> #drawOn:bounds: method. A Canvas can ask the model to redraw itself when the<br>
> Canvas becomes dirty (e.g. when sub-canvases move and the canvas has no<br>
> cached state).<br>
><br>
<br>
</div>A dirty/clean is a not a basic canvas capability.<br>
Needless to say, that for some devices (including GL) sometimes its<br>
easier and faster to redraw everything from scratch rather than care<br>
about dirty areas. Some devices (like printers) have nothing to do<br>
with dirty/clean approach.<br>
Don't let a premature optimizations influence the basic model! :)</blockquote><div><br><br>On reflection, yes, it is a premature optimisation. Hmm...<br><br></div><div><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Right, also, don't forget about relative mouse pointer motion. A good<br>
illustration of capturing a relative mouse movement is 3D first person<br>
shooter game :) It is not interesting where mouse cursor is, its only<br>
interested in amount of mouse movement along its two axises.<br>
And in fact, mouse, as device generates relative events, is knows<br>
nothing about screen size , or where mouse cursor are allowed to be.<br>
So, binding mouse to a screen space is wrong by its nature. Event<br>
should generate a relative movement, and then World (or top-level<br>
handler) can translate such events to absolute coordinates in its own<br>
space (if it cares).<br></blockquote></div><br><br>IIRC, mouse pointer events normally contain absolute coordinates in most windowing systems, including Squeak.<br><br>Mouse velocity could be passed as extra information in the event. Mouse pointer capture could be done using some key combination, although this is a "nice-to-have" feature that I won't implement in the first release.<br>
<br>Gulik.<br clear="all"><br>-- <br><a href="http://people.squeakfoundation.org/person/mikevdg">http://people.squeakfoundation.org/person/mikevdg</a><br><a href="http://gulik.pbwiki.com/">http://gulik.pbwiki.com/</a>