SFML community forums

Help => Graphics => Topic started by: man'O'war on March 22, 2014, 11:13:03 am

Title: [SOLVED] Zoom Factor/Scale for the sf::View
Post by: man'O'war on March 22, 2014, 11:13:03 am
Hello.

I'm wondering if it is possible to get the current zoom factor of a sf::View.
because i'm using a mouse-drag system and i need the zoom Factor/scale to fit the movement properly.

Coriadly
Dr.Crow
Title: Re: Zoom Factor/Scale for the sf::View
Post by: eXpl0it3r on March 22, 2014, 11:16:02 am
No, but you can easily track the factor yourself.
Title: Re: Zoom Factor/Scale for the sf::View
Post by: Nexus on March 22, 2014, 12:22:30 pm
Unlike the scale of sf::Transformable objects, sf::View's zoom factor is not a separate attribute. It merely scales the view rectangle, so zoom(factors) is just a shortcut for setSize(getSize() * factors), with * being component-wise multiplication.
Title: Re: Zoom Factor/Scale for the sf::View
Post by: man'O'war on March 22, 2014, 02:20:24 pm
Indeed, sounds clear now.
Thank you for your help.