TeselaGen / openVectorEditor

DEPRECATED - Teselagen's Open Source Vector/Plasmid Editor Component
https://teselagen.github.io/tg-oss/ove/#/Editor
MIT License
200 stars 72 forks source link

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

Closed tnrich closed 2 years ago

tnrich commented 2 years ago

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 commented 2 years ago

Closing as this has been fixed!