Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the beginnings of scrolling via dragging. #460

Closed
wants to merge 3 commits into from

Conversation

@pcwalton
Copy link
Contributor

pcwalton commented May 18, 2013

BeginDrawing(sender) => lend_surface(surfaces, sender),
BeginDrawing(sender) => surfaces.lend(sender),
Exit => *done = true,

Draw(sender, draw_target) => {

This comment has been minimized.

@metajack

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.

@metajack

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.

@metajack

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.

@metajack

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.

@metajack

metajack May 18, 2013

Contributor

This needs a docstring.

Surface {
layer_buffer_set: layer_buffer_set,
have: true
impl Surface {

This comment has been minimized.

@metajack

metajack May 18, 2013

Contributor

Needs a docstring. The docs should probably note that it returns an 800x600 surface.

@metajack
Copy link
Contributor

metajack commented May 18, 2013

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.

pcwalton added 3 commits May 17, 2013
@metajack

This comment has been minimized.

Copy link

metajack commented on 66e31aa May 21, 2013

r+

@bors-servo

This comment has been minimized.

Copy link
Contributor

bors-servo commented on 66e31aa May 21, 2013

saw approval from metajack
at pcwalton@66e31aa

This comment has been minimized.

Copy link
Contributor

bors-servo replied May 21, 2013

merging pcwalton/servo/scrolling = 66e31aa into auto

This comment has been minimized.

Copy link
Contributor

bors-servo replied May 21, 2013

pcwalton/servo/scrolling = 66e31aa merged ok, testing candidate = 4d0b92d

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

bors-servo replied May 21, 2013

fast-forwarding master to auto = 4d0b92d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.