Skip to content

Instantly share code, notes, and snippets.

@JakenHerman
Created December 8, 2020 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JakenHerman/bb0c68f66dc382a1aac664278816e6e4 to your computer and use it in GitHub Desktop.
Save JakenHerman/bb0c68f66dc382a1aac664278816e6e4 to your computer and use it in GitHub Desktop.
getTextXValue = (x) => {
const stringLength = Math.floor((x/150)*100).toString().length;
switch (stringLength) {
case 1: return x + 7;
case 2: return x + 4;
default: return x;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment