Skip to content

Commit

Permalink
refactor(core): rename getScaledDimensions to `calculateProportiona…
Browse files Browse the repository at this point in the history
…lSize`
  • Loading branch information
johannschopplich committed Nov 10, 2024
1 parent 56caa45 commit 3ee442e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/blurhash.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { decodeBlurHash } from 'fast-blurhash'
import { DEFAULT_PLACEHOLDER_SIZE } from './constants'
import { getScaledDimensions } from './utils'
import { calculateProportionalSize } from './utils'
import { rgbaToDataUri } from './utils/dataUri'

export interface BlurHashOptions {
Expand All @@ -27,7 +27,7 @@ export function createPngDataUri(
size = DEFAULT_PLACEHOLDER_SIZE,
}: BlurHashOptions = {},
) {
const { width, height } = getScaledDimensions(ratio, size)
const { width, height } = calculateProportionalSize(ratio, size)
const rgba = decodeBlurHash(hash, width, height)
return rgbaToDataUri(width, height, rgba)
}
2 changes: 1 addition & 1 deletion packages/core/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function toElementArray<T extends HTMLElement>(
return [...target]
}

export function getScaledDimensions(aspectRatio: number, referenceSize: number) {
export function calculateProportionalSize(aspectRatio: number, referenceSize: number) {
let width: number
let height: number

Expand Down

0 comments on commit 3ee442e

Please sign in to comment.