Author Topic: pcl::ImageWindow::ZoomOut can't go thru zoom 1:1  (Read 2664 times)

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
pcl::ImageWindow::ZoomOut can't go thru zoom 1:1
« on: 2011 November 10 05:31:02 »
Hello Juan,

Take the bug.
Definition at line 1996 of file ImageWindow.h.
Code: [Select]
01996    void ZoomOut()
01997    {
01998       int z = ZoomFactor() - 1;
01999       SetZoomFactor( (z != 0) ? z : -1 );
02000    }
It's doesn't work properly because SetZoomFactor ( -1 ) rally set ZoomFactor() == +1;

Work around: use SetZoomFactor( (z != 0) ? z : -2 );

Best regards,
Nikolay.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: pcl::ImageWindow::ZoomOut can't go thru zoom 1:1
« Reply #1 on: 2011 November 10 09:08:36 »
Hi Nikolay,

Good catch :)

Indeed, zoom factors 0 and -1 are reserved for future use and are currently being interpreted as +1 for compatibility reasons (although this behavior is not guaranteed to be preserved in future versions of the platform).

So the correct transition from positive to negative zoom factors is +1 -> -2, as you have pointed out.

I have already made this change to ImageWindow.h, so it will be included in the next version of PCL. Thank you!
Juan Conejero
PixInsight Development Team
http://pixinsight.com/