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

allow zoom in just one direction as an option #287

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

rleddy
Copy link

@rleddy rleddy commented Sep 25, 2022

Created an option preserveAspectRatio, which is a Boolean.

By default this is true. When true, it runs original code.

If it is false, then scaleFactors may be set as an option. These are { x : <number>, y : <number> }.
If either its x or y is zero, then the scale of the transform is always one in the chosen direction. Otherwise, the x or y value is a multiplier of scale, which is also broken up into scaleX and scaleY.

Did this by branching code on preserveAspectRatio which internally is being tracked by linkAspect, a Boolean value.

In this commit, only the SVG version is affected. Scaling still means object size changes. The aim is to watch them grow apart as a priority. { There may be cases when the object size (thickness in particular) may stay the same. This is not addressed. }

Needed this for a time line. The application needs to have boxes drawn from start times to stop times (short/long spans).

needed a left to right zoom as an option
Altered this code to make that happen
option for both x and y when the aspect ration link is broken
found a bug
Recent code changes misused animate.
Pass {x : value, y : value} for 2D scaling. animate will use scale or (x,y). Fields subjected to difference are at the top level.

Global scaling options (new option) was not being applied to zoom. Fixed. Fixed also, cases where zero scaling means don't scale but scaling is used as a multiplier of scale while some times it eliminates translation at scale for translation being shut down in one direction.
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

Successfully merging this pull request may close these issues.

1 participant