Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement the beginnings of scrolling via dragging. #460
Conversation
| BeginDrawing(sender) => lend_surface(surfaces, sender), | ||
| BeginDrawing(sender) => surfaces.lend(sender), | ||
| Exit => *done = true, | ||
|
|
||
| Draw(sender, draw_target) => { |
This comment has been minimized.
This comment has been minimized.
metajack
May 18, 2013
Contributor
While you're here, I think draw_target should be renamed. It's not a draw target, but a surface.
| image_layer.common.set_transform( | ||
| original_layer_transform.translate(x, y, 0.0) | ||
| .scale(width as f32, height as f32, 1.0)); | ||
| let mut origin = Point2D(buffer.rect.origin.x as f32, |
This comment has been minimized.
This comment has been minimized.
metajack
May 18, 2013
Contributor
Does this not warn about unused mut? I don't see where it's ever mutated.
| @@ -205,6 +209,19 @@ fn mainloop(po: Port<Msg>, script_chan: SharedChan<ScriptMsg>, opts: &Opts) { | |||
| script_chan.send(LoadMsg(url::make_url(url_string.to_str(), None))) | |||
| } | |||
|
|
|||
| // When the user scrolls, move the layer around. | |||
| do window.set_scroll_callback |delta| { | |||
| // FIXME: Can't use `+=` due to a Rust bug. | |||
This comment has been minimized.
This comment has been minimized.
metajack
May 18, 2013
Contributor
Can you note the bug number here? It makes it much easier to know when the workaround can be undone.
| // Let's look | ||
| assert!(surfaces.front.have); | ||
| } | ||
| impl SurfaceSet { |
This comment has been minimized.
This comment has been minimized.
metajack
May 18, 2013
Contributor
The implementation is now documented, but the structure should get some as well.
| SurfaceSet { front: Surface(backend), back: Surface(backend) } | ||
| // Now we have it again | ||
| self.back.have = true; | ||
| } | ||
| } | ||
|
|
||
| struct Surface { |
This comment has been minimized.
This comment has been minimized.
| Surface { | ||
| layer_buffer_set: layer_buffer_set, | ||
| have: true | ||
| impl Surface { |
This comment has been minimized.
This comment has been minimized.
metajack
May 18, 2013
Contributor
Needs a docstring. The docs should probably note that it returns an 800x600 surface.
|
First pass of testing on Linux crashes when hitting Ctrl-L. I'll try and test on OS X tomorrow and see if it's platform specific. |
This comment has been minimized.
This comment has been minimized.
metajack
commented on 66e31aa
May 21, 2013
|
r+ |
This comment has been minimized.
This comment has been minimized.
|
saw approval from metajack |
This comment has been minimized.
This comment has been minimized.
|
merging pcwalton/servo/scrolling = 66e31aa into auto |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
fast-forwarding master to auto = 4d0b92d |
pcwalton commentedMay 18, 2013
r? @metajack