Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Improve Alignment View zoom scaling to match the linear zoom scaling levels #829

Closed
1 task done
tnrich opened this issue Jun 15, 2022 · 1 comment
Closed
1 task done
Assignees

Comments

@tnrich
Copy link
Contributor

tnrich commented Jun 15, 2022

  • improve Alignment View zoom scaling to match the linear zoom scaling levels

Basically the Alignment View zooms too aggressively and instead should act more like the nice smooth zooming of the new linear view zoom

Use these new values: (in the alignment view UncontrolledSlider component)

        stepSize={0.05}
        clickStepSize={0.5}
        initialValue={0}
        max={10}
        min={0}

Use something like this logic for the zoom levels to calculate the new char width (inside the alignment view zoom handler)

          const scaleFactor = Math.pow(12 / initialCharWidth, 1 / 10);
          const newCharWidth =
            initialCharWidth * Math.pow(scaleFactor, zoomLvl);
          setCharWidth(newCharWidth);
@tnrich
Copy link
Contributor Author

tnrich commented Jul 1, 2022

Closing as this has been fixed!

@tnrich tnrich closed this as completed Jul 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants