Refactoring in zoom.py

- more functional style
- generalized for n-dimensional images


git-svn-id: svn+ssh://svn.code.sf.net/p/mcomix/code@971 ef8490bc-f317-4725-81ed-e95a9aca1bcf
Introducing _scale_distributed (new scaling approach)

This function is still not used, though.


git-svn-id: svn+ssh://svn.code.sf.net/p/mcomix/code@972 ef8490bc-f317-4725-81ed-e95a9aca1bcf
Documentation for _scale_distributed, minor refactoring


git-svn-id: svn+ssh://svn.code.sf.net/p/mcomix/code@973 ef8490bc-f317-4725-81ed-e95a9aca1bcf
Scrollbar bug fix, refactoring

Scrollbars disappear and reappear now more reliably.
However, in double page mode, it is still(!) possible to make the viewport too
small for the image but not small enough for the horizontal scrollbar to appear.
Furthermore, it is still(!) possible to make scrollbars appear when they are not
necessary (both single page mode and double page mode).

Changes in MainWindow:
- interface of _show_scrollbars changed
- _show_scrollbars simplified
- _hscroll replaced with _scroll[constants.WIDTH_AXIS]
- _vscroll replaced with _scroll[constants.HEIGHT_AXIS]

Changes in zoom.py:
- docs added for _smaller


git-svn-id: svn+ssh://svn.code.sf.net/p/mcomix/code@974 ef8490bc-f317-4725-81ed-e95a9aca1bcf
Bug fixes, refactoring, minor improvements

- Reported scale now uses diagonals. (This is simpler than the previous
implementation as it is not affected by 90-degrees-rotations anymore. Plus, it
reflects the actually visible scales better.)
- Bug fix: Rotation does not affect the reported scale anymore.
- Bug fix: Swapped width and height are now reported in double page mode as well.
- Refactoring in _draw_image: Conditions and calls regarding dynamic background
colour computation simplified. (It still shows the same quirks as it did before
when the user is currently changing the associated preferences.)
- Further preparations for removing "self.displayed_double()" switch in _draw_image.


git-svn-id: svn+ssh://svn.code.sf.net/p/mcomix/code@975 ef8490bc-f317-4725-81ed-e95a9aca1bcf
Refactoring in zoom.py

- Replace FitMode and derived classes by _calc_limits. (I hope that this doesn't
turn out to be a bad idea.)
- Convert _scale_distributed to staticmethod.
- Remove obsolete helper functions.


git-svn-id: svn+ssh://svn.code.sf.net/p/mcomix/code@976 ef8490bc-f317-4725-81ed-e95a9aca1bcf
Minor refactoring

- _calc_limits merged back into _get_preferred_scale.


git-svn-id: svn+ssh://svn.code.sf.net/p/mcomix/code@977 ef8490bc-f317-4725-81ed-e95a9aca1bcf
Very important step to overcome the double page limitation

- MainWindow now uses a list images instead of separate variables left_image or
right image, respectively. (This affects other source files as well.)
- Big "self.displayed_double()" switch in MainWindow._draw_image removed.
However, there are still two small switches left.


git-svn-id: svn+ssh://svn.code.sf.net/p/mcomix/code@978 ef8490bc-f317-4725-81ed-e95a9aca1bcf
Important UI changes, refactoring, bug fixes.

- Function fit_pixbuf_to_rectangle introduced in image_tools.py.
- No "self.displayed_double()" switches left in MainWindow._draw_image.
- Several bugs fixed (especially off-by-one errors).
- Some refactoring.

Changes that heavily influence user experience:

- You can now scale up in double page mode.
- No spacing between pages in double page mode (temporarily).
- In double page mode, both pages now have similar scale factors.
- Bug fixed that has been introduced with r974. Due to this bug, the scrollbar
requests did not converge in some special cases (aka infinite loop). The new
calculations should always converge. If you see an apparently useless scrollbar
now, this scrollbar is actually necessary.


git-svn-id: svn+ssh://svn.code.sf.net/p/mcomix/code@979 ef8490bc-f317-4725-81ed-e95a9aca1bcf