A4

Merge lp://staging/~andrea-gualano/a4/rendering into lp://staging/a4

Proposed by Andrea Gualano
Status: Merged
Merged at revision: 6
Proposed branch: lp://staging/~andrea-gualano/a4/rendering
Merge into: lp://staging/a4
Diff against target: 27 lines (+13/-3)
1 file modified
a4lib/app.py (+13/-3)
To merge this branch: bzr merge lp://staging/~andrea-gualano/a4/rendering
Reviewer Review Type Date Requested Status
Andrea Corbellini Approve
Review via email: mp+26401@code.staging.launchpad.net

Description of the change

Keep a region of interest centered and zoomed, preserving aspect ratio.

The rendering has been moved to the render method; currently the call to render() is hardcoded to show the full image, but you can change the call to self.render(context, x0, y0, x1, y1) to show a region of the original image.

To post a comment you must log in.
Revision history for this message
Andrea Corbellini (andrea.corbellini) wrote :

Hi and thanks for your branch. It looks fine, but I have a question: if I make the window smaller than the image, why the image is kept at its original size? Is it just a flaw or the desired behavior?

Also, please follow the naming conventions described in PEP8 (scaleX => scale_x) and add a docstring to render().

review: Needs Information
Revision history for this message
Andrea Gualano (andrea-gualano) wrote :

If you make the window smaller, the drawing area actually remains the same size because it's inside a scrollable viewport. I think the viewport is not needed anymore, but I'd like to discuss it before removing.

I'm a Python newbie. I'm going to study PEP8, but feel free to change anything you feel is not pythonesque enough.

Revision history for this message
Andrea Corbellini (andrea.corbellini) wrote :

Unfortunately, removing the scrolled window and the viewport introduces a new problem: the window can't be made smaller than the image. However, the changes of this branch are fine, so I'm merging them.

Thanks for your code. :-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches