Skip to content

Commit

Permalink
Fixing export
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgperry committed Nov 1, 2021
1 parent bc29e36 commit f2083a4
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/render/dom/utils/unit-conversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,24 @@ function removeNonTranslationalTransform(visualElement: VisualElement) {
return removedTransforms
}

const positionalValues: { [key: string]: GetActualMeasurementInPixels } = {
// Dimensions
width: ({ x }, { paddingLeft = "0", paddingRight = "0" }) =>
x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),
height: ({ y }, { paddingTop = "0", paddingBottom = "0" }) =>
y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),

top: (_bbox, { top }) => parseFloat(top as string),
left: (_bbox, { left }) => parseFloat(left as string),
bottom: ({ y }, { top }) => parseFloat(top as string) + (y.max - y.min),
right: ({ x }, { left }) => parseFloat(left as string) + (x.max - x.min),

// Transform
x: getTranslateFromMatrix(4, 13),
y: getTranslateFromMatrix(5, 14),
}
export const positionalValues: { [key: string]: GetActualMeasurementInPixels } =
{
// Dimensions
width: ({ x }, { paddingLeft = "0", paddingRight = "0" }) =>
x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),
height: ({ y }, { paddingTop = "0", paddingBottom = "0" }) =>
y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),

top: (_bbox, { top }) => parseFloat(top as string),
left: (_bbox, { left }) => parseFloat(left as string),
bottom: ({ y }, { top }) => parseFloat(top as string) + (y.max - y.min),
right: ({ x }, { left }) =>
parseFloat(left as string) + (x.max - x.min),

// Transform
x: getTranslateFromMatrix(4, 13),
y: getTranslateFromMatrix(5, 14),
}

const convertChangedValueTypes = (
target: TargetWithKeyframes,
Expand Down

0 comments on commit f2083a4

Please sign in to comment.