After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 131964 - Zoom ratio problem
Zoom ratio problem
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
git master
Other Linux
: Normal normal
: 2.0
Assigned To: GIMP Bugs
GIMP Bugs
Depends on: 131563
Blocks:
 
 
Reported: 2004-01-19 22:59 UTC by Seth Burgess
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Seth Burgess 2004-01-19 22:59:22 UTC
Steps to reproduce:
1) New image
2) View->Zoom->Other
3) enter 99:100 as the ratio
4) observe a 10000% zoom, where it should be 99%

(100:99 works as expected)

This will likely be a thing of the past very quickly as Simon is hacking
this area presently.
Comment 1 Simon Budig 2004-01-20 00:14:18 UTC
GSR spotted the reason for that: gimp_display_shell_scale accepts the
zoom ratio as an integer, where i / 100 is the numerator and i % 100
is the denominator of the fraction. So 99:100 gets encoded as
99*100+100 = 10000 and decoded to 100:0, 100:1 after a sanity check.

Of course this is totally insane and should be fixed at the API level.
I have a patch and can commit it if I get some thumbs up from the
maintainers (it changes not only a lot of code, but also zoom stepping).

The patch is attached to bug 131563.

Setting target milestone to 2.0.
Comment 2 Dave Neary 2004-01-20 13:43:35 UTC
Removing PATCH keyword, since there isn't one, and making this bug
depend on bug #131563. We are agreed that patch should be applied, we
are just wondering when is the right time. 

I'm still in favour of post-2.0, and would like to set the milestone
of this bug to 2.2. The only alternatives are to come up with a quick
fix for this bug which can go into 2.0 or commit the patch attached to
bug #131563 now, which could result in other bugs.

Cheers,
Dave.
Comment 3 Simon Budig 2004-01-29 22:42:47 UTC
Fixed in CVS:

2004-01-29  Simon Budig  <simon@gimp.org>

        * app/display/gimpdisplayshell.[ch]: Store the zoom factor as
        float, not as a ratio.

        * app/display/gimpdisplayshell-scale.[ch]: change the API to
        expose the Float instead a weirdly encoded integer. Implement
        functions to get a ratio from the scale factor. Implement a
        set as presets as discussed on the mailinglist. Changed
        Zoom->Other dialog to enable entering a float.

        * app/display/gimpdisplayshell-title.c
        * app/display/gimpnavigationview.c
        * app/gui/image-menu.c
        * app/gui/info-window.c
        * app/tools/gimpmagnifytool.c: changed accordingly.

        * app/core/gimp.[ch]
        * app/display/gimpdisplay.[ch]
        * app/gui/gui-vtable.c
        * app/widgets/widgets-enums.h: Made the various
        display-creating functions accept a float for the scale.
        Introduce a new GimpZoomType: GIMP_ZOOM_TO. Generally adjust
        the API to use floats instead of weird integers.

        * app/core/gimp-edit.c
        * app/core/gimptemplate.c
        * app/display/gimpdisplayshell-callbacks.c
        * app/file/file-open.c
        * app/gui/image-commands.c
        * app/gui/view-commands.[ch]
        * tools/pdbgen/pdb/display.pdb
        * app/widgets/gimpimageview.c
        * app/widgets/gimptoolbox-dnd.c: changed accordingly

        * app/pdb/display_cmds.c: regenerated