Skip to content

Commit 41ad1c2

Browse files
committed
Updated to new API from angle to rotate
1 parent 4975ef3 commit 41ad1c2

19 files changed

+8419
-8059
lines changed

app/build/mojs-curve-editor.js

Lines changed: 8269 additions & 7909 deletions
Large diffs are not rendered by default.

app/build/mojs-curve-editor.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"code-panel":"_code-panel_nnb9p_3","code-panel__inner":"_code-panel__inner_nnb9p_1","code-panel__input-wrap":"_code-panel__input-wrap_nnb9p_1","code-panel__input-field":"_code-panel__input-field_nnb9p_1","is-open":"_is-open_nnb9p_61"}
1+
{"code-panel":"_code-panel_r9rmj_3","code-panel__inner":"_code-panel__inner_r9rmj_1","code-panel__input-wrap":"_code-panel__input-wrap_r9rmj_1","code-panel__input-field":"_code-panel__input-field_r9rmj_1","is-open":"_is-open_r9rmj_61"}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"little-handle":"_little-handle_x1mg1_3","little-handle__point":"_little-handle__point_x1mg1_1","little-handle__easy-touch":"_little-handle__easy-touch_x1mg1_1","little-handle__line":"_little-handle__line_x1mg1_1"}
1+
{"little-handle":"_little-handle_3dk3h_3","little-handle__point":"_little-handle__point_3dk3h_1","little-handle__easy-touch":"_little-handle__easy-touch_3dk3h_1","little-handle__line":"_little-handle__line_3dk3h_1"}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"point-controls":"_point-controls_1xcu7_4","is-show":"_is-show_1xcu7_7"}
1+
{"point-controls":"_point-controls_16z63_4","is-show":"_is-show_16z63_7"}

app/css/blocks/point.postcss.css.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"point":"_point_14jnp_5","point__touch":"_point__touch_14jnp_1","is-selected":"_is-selected_14jnp_31","is-hide-handles":"_is-hide-handles_14jnp_43"}
1+
{"point":"_point_zvcv8_5","point__touch":"_point__touch_zvcv8_1","is-selected":"_is-selected_zvcv8_31","is-hide-handles":"_is-hide-handles_zvcv8_43"}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"resize-handle":"_resize-handle_1uncf_4","resize-handle--right":"_resize-handle--right_1uncf_1","resize-handle--bottom":"_resize-handle--bottom_1uncf_1"}
1+
{"resize-handle":"_resize-handle_5miht_4","resize-handle--right":"_resize-handle--right_5miht_1","resize-handle--bottom":"_resize-handle--bottom_5miht_1"}

app/css/blocks/ruler.postcss.css.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"ruler":"_ruler_1c43h_4","ruler--right":"_ruler--right_1c43h_1","ruler__item":"_ruler__item_1c43h_1","ruler__item--0":"_ruler__item--0_1c43h_1","ruler__item--1":"_ruler__item--1_1c43h_1","ruler__item--2":"_ruler__item--2_1c43h_1","ruler__item--n1":"_ruler__item--n1_1c43h_1","ruler__item--n2":"_ruler__item--n2_1c43h_1"}
1+
{"ruler":"_ruler_qlwtd_4","ruler--right":"_ruler--right_qlwtd_1","ruler__item":"_ruler__item_qlwtd_1","ruler__item--0":"_ruler__item--0_qlwtd_1","ruler__item--1":"_ruler__item--1_qlwtd_1","ruler__item--2":"_ruler__item--2_qlwtd_1","ruler__item--n1":"_ruler__item--n1_qlwtd_1","ruler__item--n2":"_ruler__item--n2_qlwtd_1"}

app/js/helpers/angle-to-point.babel.js

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11

2-
import angleToPoint from './angle-to-point';
2+
import rotateToPoint from './rotate-to-point';
33
import C from '../constants';
44

55
export default (point, handleIndex = 1) => {
6-
const x = point.x + point.tempX,
7-
y = point.y + point.tempY,
8-
handle = point[`handle${handleIndex}`];
6+
const x = point.x + point.tempX,
7+
y = point.y + point.tempY,
8+
handle = point[`handle${handleIndex}`];
99

10-
const CHAR = ( handleIndex === 2 ) ? 'C' : '';
11-
if ( point.type !== 'straight' ) {
12-
const handleCoords = angleToPoint( handle.angle, handle.radius );
13-
return `${CHAR}${x + handleCoords.x/C.CURVE_PERCENT}, ${(y + handleCoords.y)/C.CURVE_PERCENT} `;
10+
const CHAR = (handleIndex === 2) ? 'C' : '';
11+
if (point.type !== 'straight') {
12+
const handleCoords = rotateToPoint(handle.rotate, handle.radius);
13+
return `${CHAR}${x + handleCoords.x / C.CURVE_PERCENT}, ${(y + handleCoords.y) / C.CURVE_PERCENT} `;
1414
} else {
15-
return `${CHAR}${x}, ${y/C.CURVE_PERCENT} `;
15+
return `${CHAR}${x}, ${y / C.CURVE_PERCENT} `;
1616
}
1717
}

0 commit comments

Comments
 (0)