remove opinionated changes from react-components
This commit is contained in:
parent
1ea470aa87
commit
5905e999a1
4 changed files with 6 additions and 13 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { forwardRef } from 'react'
|
import React, { forwardRef } from 'react'
|
||||||
|
|
||||||
export const Group = forwardRef((props, ref) => (
|
export const Group = forwardRef((props, ref) => (
|
||||||
<g {...props} ref={ref}>
|
<g {...props} ref={ref}>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { forwardRef } from 'react'
|
import React, { forwardRef } from 'react'
|
||||||
// Components that can be swizzled
|
// Components that can be swizzled
|
||||||
import { Svg as DefaultSvg } from './svg.mjs'
|
import { Svg as DefaultSvg } from './svg.mjs'
|
||||||
import { Defs as DefaultDefs } from './defs.mjs'
|
import { Defs as DefaultDefs } from './defs.mjs'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
export const getProps = (obj) => {
|
export const getProps = (obj) => {
|
||||||
/** I can't believe it but there seems to be no method on NPM todo this */
|
/** I can't believe it but there seems to be no method on NPM todo this */
|
||||||
const cssKey = (key) => {
|
const cssKey = (key) => {
|
||||||
|
@ -36,16 +38,6 @@ export const getProps = (obj) => {
|
||||||
return props
|
return props
|
||||||
}
|
}
|
||||||
|
|
||||||
export const dx = (pointA, pointB) => pointB.x - pointA.x
|
|
||||||
export const dy = (pointA, pointB) => pointB.y - pointA.y
|
|
||||||
export const rad2deg = (radians) => radians * 57.29577951308232
|
|
||||||
export const angle = (pointA, pointB) => {
|
|
||||||
let rad = Math.atan2(-1 * dy(pointA, pointB), dx(pointA, pointB))
|
|
||||||
while (rad < 0) rad += 2 * Math.PI
|
|
||||||
|
|
||||||
return rad2deg(rad)
|
|
||||||
}
|
|
||||||
|
|
||||||
export const withinPartBounds = (point, part) =>
|
export const withinPartBounds = (point, part) =>
|
||||||
point.x >= part.topLeft.x &&
|
point.x >= part.topLeft.x &&
|
||||||
point.x <= part.bottomRight.x &&
|
point.x <= part.bottomRight.x &&
|
||||||
|
|
|
@ -45,7 +45,8 @@
|
||||||
*/
|
*/
|
||||||
import { useRef, useState, useEffect, useCallback } from 'react'
|
import { useRef, useState, useEffect, useCallback } from 'react'
|
||||||
import { generateStackTransform, getTransformedBounds } from '@freesewing/core'
|
import { generateStackTransform, getTransformedBounds } from '@freesewing/core'
|
||||||
import { getProps, angle } from 'pkgs/react-components/src/pattern/utils.mjs'
|
import { getProps } from 'pkgs/react-components/src/pattern/utils.mjs'
|
||||||
|
import { angle } from '../utils.mjs'
|
||||||
import { drag } from 'd3-drag'
|
import { drag } from 'd3-drag'
|
||||||
import { select } from 'd3-selection'
|
import { select } from 'd3-selection'
|
||||||
import { Buttons } from './transform-buttons.mjs'
|
import { Buttons } from './transform-buttons.mjs'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue