@@ -75,7 +75,7 @@ return /******/ (function(modules) { // webpackBootstrap
75
75
/******/ }
76
76
/******/
77
77
/******/ var hotApplyOnUpdate = true ;
78
- /******/ var hotCurrentHash = "eb4b9d857ba05af5b0bb " ; // eslint-disable-line no-unused-vars
78
+ /******/ var hotCurrentHash = "07485cea7385da19154c " ; // eslint-disable-line no-unused-vars
79
79
/******/ var hotCurrentModuleData = { } ;
80
80
/******/ var hotCurrentParents = [ ] ; // eslint-disable-line no-unused-vars
81
81
/******/
@@ -613,7 +613,6 @@ return /******/ (function(modules) { // webpackBootstrap
613
613
__webpack_require__ ( 137 ) ;
614
614
615
615
document . addEventListener ( 'DOMContentLoaded' , function ( ) {
616
- // riot.mount('*',{ store: store })
617
616
riot . mount ( 'curve-editor' , { store : _store2 . default } ) ;
618
617
} ) ;
619
618
/* WEBPACK VAR INJECTION */ } . call ( exports , __webpack_require__ ( 2 ) ) )
@@ -3798,7 +3797,7 @@ return /******/ (function(modules) { // webpackBootstrap
3798
3797
/* WEBPACK VAR INJECTION */ ( function ( riot ) {
3799
3798
__webpack_require__ ( 13 ) ;
3800
3799
3801
- riot . tag2 ( 'curve' , '<div class="{this.CLASSES[\'curve__svg-wrapper\']}" riot-style="{this.styles.transform}"> <point each="{point, _index in points}" points-count="{parent.points.length}"></point> <svg height="358 " viewbox="0 0 100 100" preserveaspectratio="none" class="{this.CLASSES[\'curve__svg\']}"> <path riot-d="{this.path}" stroke="#000000" stroke-opacity="0.35" stroke-width="4" vector-effect="non-scaling-stroke" transform="translate(.75,.75)" fill="none"></path> <g id="js-segments"> <path each="{this.segments}" riot-d="{str}" data-index="{index}" stroke="white" fill="none" stroke-width="" vector-effect="non-scaling-stroke" class="{this.CLASSES[\'curve__svg-segment\']}"></path> </g> </svg> </div>' , '' , 'class="{this.CLASSES[\'curve\']}" riot-style="{this.styles.background}"' , function ( opts ) {
3800
+ riot . tag2 ( 'curve' , '<div class="{this.CLASSES[\'curve__svg-wrapper\']}" riot-style="{this.styles.transform}"> <point each="{point, _index in points}" points-count="{parent.points.length}"></point> <svg height="350 " viewbox="0 0 100 100" preserveaspectratio="none" class="{this.CLASSES[\'curve__svg\']}"> <path riot-d="{this.path}" stroke="#000000" stroke-opacity="0.35" stroke-width="4" vector-effect="non-scaling-stroke" transform="translate(.75,.75)" fill="none"></path> <g id="js-segments"> <path each="{this.segments}" riot-d="{str}" data-index="{index}" stroke="white" fill="none" stroke-width="" vector-effect="non-scaling-stroke" class="{this.CLASSES[\'curve__svg-segment\']}"></path> </g> </svg> </div>' , '' , 'class="{this.CLASSES[\'curve\']}" riot-style="{this.styles.background}"' , function ( opts ) {
3802
3801
'use strict' ;
3803
3802
3804
3803
var _this = this ;
@@ -3997,6 +3996,10 @@ return /******/ (function(modules) { // webpackBootstrap
3997
3996
3998
3997
var _resizeMod2 = _interopRequireDefault ( _resizeMod ) ;
3999
3998
3999
+ var _roundTo = __webpack_require__ ( 141 ) ;
4000
+
4001
+ var _roundTo2 = _interopRequireDefault ( _roundTo ) ;
4002
+
4000
4003
function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { default : obj } ; }
4001
4004
4002
4005
this . CLASSES = __webpack_require__ ( 108 ) ;
@@ -4057,7 +4060,7 @@ return /******/ (function(modules) { // webpackBootstrap
4057
4060
} else if ( _this . point . x + x > 100 ) {
4058
4061
return 100 - _this . point . x ;
4059
4062
}
4060
- return x ;
4063
+ return ( 0 , _roundTo2 . default ) ( x , 5 , 1.5 ) ;
4061
4064
} ;
4062
4065
4063
4066
var getY = function getY ( e ) {
@@ -4077,13 +4080,16 @@ return /******/ (function(modules) { // webpackBootstrap
4077
4080
var resize = _store$getState4 . resize ;
4078
4081
var y = _this . point . y + e . deltaY ;
4079
4082
4083
+ var returnValue = y ;
4080
4084
if ( y < resize . top ) {
4081
- return resize . top - _this . point . y ;
4082
- }
4083
- if ( y > _constants2 . default . CURVE_SIZE + resize . bottom ) {
4084
- return _constants2 . default . CURVE_SIZE + resize . bottom - _this . point . y ;
4085
+ returnValue = resize . top - _this . point . y ;
4086
+ } else if ( y > _constants2 . default . CURVE_SIZE + resize . bottom ) {
4087
+ returnValue = _constants2 . default . CURVE_SIZE + resize . bottom - _this . point . y ;
4088
+ } else {
4089
+ returnValue = e . deltaY ;
4085
4090
}
4086
- return e . deltaY ;
4091
+
4092
+ return ( 0 , _roundTo2 . default ) ( returnValue , 10 * _constants2 . default . CURVE_PERCENT , 2 * _constants2 . default . CURVE_PERCENT ) ;
4087
4093
} ;
4088
4094
4089
4095
this . on ( 'mount' , function ( ) {
@@ -10136,10 +10142,10 @@ return /******/ (function(modules) { // webpackBootstrap
10136
10142
/***/ function ( module , exports ) {
10137
10143
10138
10144
module . exports = {
10139
- "curve" : "_curve_1gafb_5 " ,
10140
- "curve__svg-wrapper" : "_curve__svg-wrapper_1gafb_1 " ,
10141
- "curve__svg" : "_curve__svg_1gafb_1 " ,
10142
- "curve__svg-segment" : "_curve__svg-segment_1gafb_1 "
10145
+ "curve" : "_curve_1y7gw_5 " ,
10146
+ "curve__svg-wrapper" : "_curve__svg-wrapper_1y7gw_1 " ,
10147
+ "curve__svg" : "_curve__svg_1y7gw_1 " ,
10148
+ "curve__svg-segment" : "_curve__svg-segment_1y7gw_1 "
10143
10149
} ;
10144
10150
10145
10151
/***/ } ,
@@ -10177,7 +10183,7 @@ return /******/ (function(modules) { // webpackBootstrap
10177
10183
10178
10184
10179
10185
// module
10180
- exports . push ( [ module . id , "._curve_1gafb_5 {position:absolute;left:0;top:10px;right:10px;bottom:10px;border-radius:2px;background:rgba(58,8,58,.75);border:1px solid #9c829a;box-shadow:inset 4px 4px 0 rgba(0,0,0,.5);z-index:2}._curve__svg-wrapper_1gafb_1 {position:absolute;left:-1px;top :-1px;width:100%}._curve__svg_1gafb_1 {display:block;overflow:visible;width:100%}._curve__svg-segment_1gafb_1 {stroke:#fff;stroke-width:2px;cursor:crosshair}._curve__svg-segment_1gafb_1 :hover{stroke:#ff512f}" , "" ] ) ;
10186
+ exports . push ( [ module . id , "._curve_1y7gw_5 {position:absolute;left:0;top:10px;right:10px;bottom:10px;border-radius:2px;background:rgba(58,8,58,.75);border:1px solid #9c829a;box-shadow:inset 4px 4px 0 rgba(0,0,0,.5);z-index:2}._curve__svg-wrapper_1y7gw_1 {position:absolute;left:-1px;right :-1px}._curve__svg_1y7gw_1 {display:block;overflow:visible;width:100%}._curve__svg-segment_1y7gw_1 {stroke:#fff;stroke-width:2px;cursor:crosshair}._curve__svg-segment_1y7gw_1 :hover{stroke:#ff512f}" , "" ] ) ;
10181
10187
10182
10188
// exports
10183
10189
@@ -10187,7 +10193,6 @@ return /******/ (function(modules) { // webpackBootstrap
10187
10193
/***/ function ( module , exports , __webpack_require__ ) {
10188
10194
10189
10195
/* WEBPACK VAR INJECTION */ ( function ( riot ) {
10190
-
10191
10196
riot . tag2 ( 'code-panel' , '<div class="{this.CLASSES[\'code-panel__input-wrap\']}"> <input class="{this.CLASSES[\'code-panel__input-field\']}" type="text" readonly="readonly" value="M0,100 C0,100 12.0486221,-124.260309 24,99.7583642 C28.9933624,142.723104"> </div>' , '' , 'class="{this.CLASSES[\'code-panel\']}"' , function ( opts ) {
10192
10197
'use strict' ;
10193
10198
@@ -10647,7 +10652,7 @@ return /******/ (function(modules) { // webpackBootstrap
10647
10652
10648
10653
10649
10654
// module
10650
- exports . push ( [ module . id , "._curve-editor_1sc6s_4{position:fixed;left:0;top:0;width:411px;height:398px;border-radius:12px;background:rgba(58,8,58,.85);z-index:100;box-shadow:2px 2px 2px rgba(0,0,0,.38)}._curve-editor__left_1sc6s_1{position:absolute;width:42px;left:0;top:0;bottom:0;padding:10px}._curve-editor__left_1sc6s_1 icon-divider{margin:10px auto}._curve-editor__right_1sc6s_1{position:absolute;left:43px;top:0;right:0;bottom:0}._curve-editor__right_1sc6s_1 resize-handle{position:absolute}._curve-editor__right_1sc6s_1 resize-handle[type=top]{top:-16px}._curve-editor__right_1sc6s_1 resize-handle[type=bottom]{bottom:0}._curve-editor__right_1sc6s_1 resize-handle[type=bottom],._curve-editor__right_1sc6s_1 resize-handle[type=top]{left:50%;margin-left:-21px}._curve-editor__right_1sc6s_1 resize-handle[type=right]{right:-16px;top:50%;margin-top:-16px}._curve-editor__anchor-buttons_1sc6s_1{margin-top:10px}._curve-editor__anchor-buttons_1sc6s_1 icon-button{margin-bottom:5px}._curve-editor__mojs-logo_1sc6s_1{position:absolute;bottom:17px;left:50%;margin-left:1px;-webkit-transform:translateX(-50%);transform:translateX(-50%)}._curve-editor__mojs-logo_1sc6s_1 icon{fill:#ff512f;width:12px;height:12px}" , "" ] ) ;
10655
+ exports . push ( [ module . id , "._curve-editor_1vq6l_4{position:fixed;left:0;top:0;width:403px;height:378px;border-radius:12px;background:rgba(58,8,58,.85);z-index:100;box-shadow:2px 2px 2px rgba(0,0,0,.38)}._curve-editor__left_1vq6l_1{position:absolute;width:42px;left:0;top:0;bottom:0;padding:10px}._curve-editor__left_1vq6l_1 icon-divider{margin:10px auto}._curve-editor__right_1vq6l_1{position:absolute;left:43px;top:0;right:0;bottom:0}._curve-editor__right_1vq6l_1 resize-handle{position:absolute}._curve-editor__right_1vq6l_1 resize-handle[type=top]{top:-16px}._curve-editor__right_1vq6l_1 resize-handle[type=bottom]{bottom:0}._curve-editor__right_1vq6l_1 resize-handle[type=bottom],._curve-editor__right_1vq6l_1 resize-handle[type=top]{left:50%;margin-left:-21px}._curve-editor__right_1vq6l_1 resize-handle[type=right]{right:-16px;top:50%;margin-top:-16px}._curve-editor__anchor-buttons_1vq6l_1{margin-top:10px}._curve-editor__anchor-buttons_1vq6l_1 icon-button{margin-bottom:5px}._curve-editor__mojs-logo_1vq6l_1{position:absolute;bottom:17px;left:50%;margin-left:1px;-webkit-transform:translateX(-50%);transform:translateX(-50%)}._curve-editor__mojs-logo_1vq6l_1 icon{fill:#ff512f;width:12px;height:12px}" , "" ] ) ;
10651
10656
10652
10657
// exports
10653
10658
@@ -10657,11 +10662,11 @@ return /******/ (function(modules) { // webpackBootstrap
10657
10662
/***/ function ( module , exports ) {
10658
10663
10659
10664
module . exports = {
10660
- "curve-editor" : "_curve-editor_1sc6s_4 " ,
10661
- "curve-editor__left" : "_curve-editor__left_1sc6s_1 " ,
10662
- "curve-editor__right" : "_curve-editor__right_1sc6s_1 " ,
10663
- "curve-editor__anchor-buttons" : "_curve-editor__anchor-buttons_1sc6s_1 " ,
10664
- "curve-editor__mojs-logo" : "_curve-editor__mojs-logo_1sc6s_1 "
10665
+ "curve-editor" : "_curve-editor_1vq6l_4 " ,
10666
+ "curve-editor__left" : "_curve-editor__left_1vq6l_1 " ,
10667
+ "curve-editor__right" : "_curve-editor__right_1vq6l_1 " ,
10668
+ "curve-editor__anchor-buttons" : "_curve-editor__anchor-buttons_1vq6l_1 " ,
10669
+ "curve-editor__mojs-logo" : "_curve-editor__mojs-logo_1vq6l_1 "
10665
10670
} ;
10666
10671
10667
10672
/***/ } ,
@@ -10714,7 +10719,7 @@ return /******/ (function(modules) { // webpackBootstrap
10714
10719
value : true
10715
10720
} ) ;
10716
10721
10717
- var CURVE_SIZE = 358 ;
10722
+ var CURVE_SIZE = 350 ;
10718
10723
exports . default = {
10719
10724
CURVE_SIZE : CURVE_SIZE ,
10720
10725
CURVE_PERCENT : CURVE_SIZE / 100 ,
@@ -10735,6 +10740,22 @@ return /******/ (function(modules) { // webpackBootstrap
10735
10740
return mojs . h . getRadialPoint ( { angle : angle , radius : radius , center : { x : 0 , y : 0 } } ) ;
10736
10741
} ;
10737
10742
10743
+ /***/ } ,
10744
+ /* 141 */
10745
+ /***/ function ( module , exports ) {
10746
+
10747
+ "use strict" ;
10748
+
10749
+ Object . defineProperty ( exports , "__esModule" , {
10750
+ value : true
10751
+ } ) ;
10752
+
10753
+ exports . default = function ( value , base , snap ) {
10754
+ var modified = Math . round ( value / base ) * base ;
10755
+
10756
+ return Math . abs ( value - modified ) < snap ? modified : value ;
10757
+ } ;
10758
+
10738
10759
/***/ }
10739
10760
/******/ ] )
10740
10761
} ) ;
0 commit comments