Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: make zoomManager.setScale() method to set the scale in direct accordance with the parameter passed to it. #14

Open
AlexDEVpro opened this issue Jul 16, 2020 · 0 comments

Comments

@AlexDEVpro
Copy link

AlexDEVpro commented Jul 16, 2020

Expected Behavior

The setScale (1) method call must set the scale value to 1 so that the getScale () method call then returns 1.

Actual Behavior

Calling the setScale(1) method sets the scale value relative to the current value, and the initial value doesn't even equal 1 due to the inline change to scale in the render() method.

To set the scale to 1 now, you have to do this:

const actualTargetScale = 1;

const initialScale = this.zoomManager.getScale();
const scaleWithAllObjects = this.zoomManager.getScaleWithAllObjects();

const coefficient = initialScale / scaleWithAllObjects;

this.zoomManager.setScale(coefficient / actualTargetScale);

Steps to Reproduce the Problem

  1. Display the layout of the large hall so that the initial scale after calling render() is not equal to 1.
  2. Call zoomManager.setScale(1).
  3. Call zoomManager.getScale(). If the received value is not equal to 1, the problem is relevant.

Specifications

  • Version: latest commit at present: e2d5ae2 on 16 Dec 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant