Skip to content

Commit

Permalink
Kevin Qualters review: remove useMemo, use more named constants for r…
Browse files Browse the repository at this point in the history
…eadability
  • Loading branch information
Brent Kimmel committed Apr 9, 2020
1 parent ef59961 commit b0f29c1
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ export const ProcessEventDot = styled(
* 18.75 : The smallest readable font size at which labels/descriptions can be read. Font size will not scale below this.
* 12.5 : A 'slope' at which the font size will scale w.r.t. to zoom level otherwise
*/
const scaledTypeSize = useMemo(() => {
return magFactorX > 1 ? 18.75 + 12.5 * (magFactorX - 1) : 18.75;
}, [magFactorX]);
const minimumFontSize = 18.75;
const slopeOfFontScale = 12.5;
const fontSizeAdjustmentForScale = magFactorX > 1 ? slopeOfFontScale * (magFactorX - 1) : 0;
const scaledTypeSize = minimumFontSize + fontSizeAdjustmentForScale;

const markerBaseSize = 15;
const markerSize = markerBaseSize;
Expand Down

0 comments on commit b0f29c1

Please sign in to comment.