@@ -75,7 +75,7 @@ return /******/ (function(modules) { // webpackBootstrap
75
75
/******/ }
76
76
/******/
77
77
/******/ var hotApplyOnUpdate = true ;
78
- /******/ var hotCurrentHash = "ae2a7386cedcd40b60d0 " ; // eslint-disable-line no-unused-vars
78
+ /******/ var hotCurrentHash = "beedde8670b73117e350 " ; // eslint-disable-line no-unused-vars
79
79
/******/ var hotCurrentModuleData = { } ;
80
80
/******/ var hotCurrentParents = [ ] ; // eslint-disable-line no-unused-vars
81
81
/******/
@@ -3909,6 +3909,13 @@ return /******/ (function(modules) { // webpackBootstrap
3909
3909
data : { x : x , y : y , index : index } ,
3910
3910
isRecord : true
3911
3911
} ) ;
3912
+
3913
+ _store2 . default . dispatch ( {
3914
+ type : 'POINT_SELECT' ,
3915
+ data : { index : index }
3916
+ } ) ;
3917
+
3918
+ e . stopPropagation ( ) ;
3912
3919
} ) ;
3913
3920
} ) ;
3914
3921
} ) ;
@@ -3919,7 +3926,9 @@ return /******/ (function(modules) { // webpackBootstrap
3919
3926
/* 13 */
3920
3927
/***/ function ( module , exports , __webpack_require__ ) {
3921
3928
3922
- /* WEBPACK VAR INJECTION */ ( function ( riot ) { riot . tag2 ( 'point' , '' , '' , 'class="{this.getClass()}" riot-style="{this.getStyle()}"' , function ( opts ) {
3929
+ /* WEBPACK VAR INJECTION */ ( function ( riot ) { __webpack_require__ ( 135 ) ;
3930
+
3931
+ riot . tag2 ( 'point' , '<little-handle each="{this.handles}"></little-handle>' , '' , 'class="{this.getClass()}" riot-style="{this.getStyle()}"' , function ( opts ) {
3923
3932
'use strict' ;
3924
3933
3925
3934
var _this = this ;
@@ -3945,13 +3954,22 @@ return /******/ (function(modules) { // webpackBootstrap
3945
3954
this . CLASSES = __webpack_require__ ( 104 ) ;
3946
3955
__webpack_require__ ( 105 ) ;
3947
3956
3948
- _store2 . default . subscribe ( this . update . bind ( this ) ) ;
3949
3957
var clamp = mojs . h . clamp ;
3950
3958
3959
+ this . getHandles = function ( ) {
3960
+ _this . handles = [ _this . point . handle1 , _this . point . handle2 ] ;
3961
+ } ;
3962
+
3963
+ this . getHandles ( ) ;
3964
+ _store2 . default . subscribe ( function ( ) {
3965
+ _this . getHandles ( ) ; _this . update ( ) ;
3966
+ } ) ;
3967
+
3951
3968
this . getClass = function ( ) {
3952
3969
var isSelected = _this . point . isSelected ? _this . CLASSES [ 'is-selected' ] : '' ;
3970
+ var isHideHandles = _this . point . type === 'straight' ? _this . CLASSES [ 'is-hide-handles' ] : '' ;
3953
3971
3954
- return _this . CLASSES [ 'point' ] + ' ' + isSelected ;
3972
+ return _this . CLASSES [ 'point' ] + ' ' + isSelected + ' ' + isHideHandles ;
3955
3973
} ;
3956
3974
3957
3975
this . getStyle = function ( ) {
@@ -6778,8 +6796,8 @@ return /******/ (function(modules) { // webpackBootstrap
6778
6796
type : fallback ( o . type , 'straight' )
6779
6797
} , makePositionPoint ( o ) , {
6780
6798
// add curve handles
6781
- handle1 : makePositionPoint ( o . handle1 ) ,
6782
- handle2 : makePositionPoint ( o . handle2 )
6799
+ handle1 : makePositionPoint ( o . handle1 || { x : - 25 , y : - 25 } ) ,
6800
+ handle2 : makePositionPoint ( o . handle2 || { x : 25 , y : - 25 } )
6783
6801
} ) ;
6784
6802
} ;
6785
6803
@@ -6811,6 +6829,10 @@ return /******/ (function(modules) { // webpackBootstrap
6811
6829
var action = arguments [ 1 ] ;
6812
6830
6813
6831
switch ( action . type ) {
6832
+ // probably redundant
6833
+ // case 'POINT_ADD': {
6834
+ // return { ...state, isShow: true, type: 'straight' };
6835
+ // }
6814
6836
case 'POINT_SELECT' :
6815
6837
{
6816
6838
return ( 0 , _extends3 . default ) ( { } , state , { isShow : ! action . isDeselect , type : action . data . type } ) ;
@@ -9750,8 +9772,9 @@ return /******/ (function(modules) { // webpackBootstrap
9750
9772
/***/ function ( module , exports ) {
9751
9773
9752
9774
module . exports = {
9753
- "point" : "_point_1bj5r_5" ,
9754
- "is-selected" : "_is-selected_1bj5r_29"
9775
+ "point" : "_point_eogtk_5" ,
9776
+ "is-selected" : "_is-selected_eogtk_40" ,
9777
+ "is-hide-handles" : "_is-hide-handles_eogtk_50"
9755
9778
} ;
9756
9779
9757
9780
/***/ } ,
@@ -9789,7 +9812,7 @@ return /******/ (function(modules) { // webpackBootstrap
9789
9812
9790
9813
9791
9814
// module
9792
- exports . push ( [ module . id , "._point_1bj5r_5 {position:absolute;width:10px;height:10px;margin-left:-5px;margin-top:-5px;cursor:move;background:#fff;border-radius:50%;z-index:3;box-shadow:3px 3px 0 rgba(0,0,0,.5)}._point_1bj5r_5: after{content:'';position:absolute;left:50%;top:50%;width:20px;height:20px;margin-left:-10px;margin-top:-10px}._point_1bj5r_5 ._is-selected_1bj5r_29,._point_1bj5r_5 :hover{border:2px solid #8c6d8b}" , "" ] ) ;
9815
+ exports . push ( [ module . id , "._point_eogtk_5 {position:absolute;width:10px;height:10px;margin-left:-5px;margin-top:-5px;cursor:move;background:#fff;border-radius:50%;z-index:3;box-shadow:3px 3px 0 rgba(0,0,0,.5);border:2px solid #fff}._point_eogtk_5 little-handle{position:absolute;left:50%;top:50%;margin-left:-3px;margin-top:-3px}._point_eogtk_5: after{content:'';position:absolute;left:50%;top:50%;width:20px;height:20px;margin-left:-10px;margin-top:-10px}._point_eogtk_5 ._is-selected_eogtk_40,._point_eogtk_5 :hover{border-color: #8c6d8b}._point_eogtk_5._is-selected_eogtk_40 little-handle{display:block}._point_eogtk_5._is-hide-handles_eogtk_50 little-handle{display:none }" , "" ] ) ;
9793
9816
9794
9817
// exports
9795
9818
@@ -9799,10 +9822,10 @@ return /******/ (function(modules) { // webpackBootstrap
9799
9822
/***/ function ( module , exports ) {
9800
9823
9801
9824
module . exports = {
9802
- "curve" : "_curve_15852_5 " ,
9803
- "curve__svg-wrapper" : "_curve__svg-wrapper_15852_1 " ,
9804
- "curve__svg" : "_curve__svg_15852_1 " ,
9805
- "curve__svg-segment" : "_curve__svg-segment_15852_1 "
9825
+ "curve" : "_curve_1jj2s_5 " ,
9826
+ "curve__svg-wrapper" : "_curve__svg-wrapper_1jj2s_1 " ,
9827
+ "curve__svg" : "_curve__svg_1jj2s_1 " ,
9828
+ "curve__svg-segment" : "_curve__svg-segment_1jj2s_1 "
9806
9829
} ;
9807
9830
9808
9831
/***/ } ,
@@ -9840,7 +9863,7 @@ return /******/ (function(modules) { // webpackBootstrap
9840
9863
9841
9864
9842
9865
// module
9843
- exports . push ( [ module . id , "._curve_15852_5 {position:absolute;left:0;top:10px;right:10px;bottom:10px;border-radius:2px;background:rgba(58,8,58,.75);border:1px solid #b3a0b2;box-shadow:inset 4px 4px 0 rgba(0,0,0,.5)}._curve__svg-wrapper_15852_1 {position:absolute;left:-1px;top:-1px;width:100%}._curve__svg_15852_1 {display:block;overflow:visible;width:100%}._curve__svg-segment_15852_1 {stroke:#fff;stroke-width:2px;cursor:crosshair}._curve__svg-segment_15852_1 :hover{stroke:#ff512f}" , "" ] ) ;
9866
+ exports . push ( [ module . id , "._curve_1jj2s_5 {position:absolute;left:0;top:10px;right:10px;bottom:10px;border-radius:2px;background:rgba(58,8,58,.75);border:1px solid #b3a0b2;box-shadow:inset 4px 4px 0 rgba(0,0,0,.5);z-index:2 }._curve__svg-wrapper_1jj2s_1 {position:absolute;left:-1px;top:-1px;width:100%}._curve__svg_1jj2s_1 {display:block;overflow:visible;width:100%}._curve__svg-segment_1jj2s_1 {stroke:#fff;stroke-width:2px;cursor:crosshair}._curve__svg-segment_1jj2s_1 :hover{stroke:#ff512f}" , "" ] ) ;
9844
9867
9845
9868
// exports
9846
9869
@@ -9863,9 +9886,9 @@ return /******/ (function(modules) { // webpackBootstrap
9863
9886
/***/ function ( module , exports ) {
9864
9887
9865
9888
module . exports = {
9866
- "code-panel" : "_code-panel_1viyz_3 " ,
9867
- "code-panel__input-wrapp" : "_code-panel__input-wrapp_1viyz_1 " ,
9868
- "code-panel__input-field" : "_code-panel__input-field_1viyz_1 "
9889
+ "code-panel" : "_code-panel_1pe78_3 " ,
9890
+ "code-panel__input-wrapp" : "_code-panel__input-wrapp_1pe78_1 " ,
9891
+ "code-panel__input-field" : "_code-panel__input-field_1pe78_1 "
9869
9892
} ;
9870
9893
9871
9894
/***/ } ,
@@ -9903,7 +9926,7 @@ return /******/ (function(modules) { // webpackBootstrap
9903
9926
9904
9927
9905
9928
// module
9906
- exports . push ( [ module . id , "._code-panel_1viyz_3 {position:absolute;left:10px;top:-32px;width:391px;height:32px;margin:0 auto;border-radius:6px 6px 0 0;background:#3d1b3c;z-index:3 }._code-panel__input-wrapp_1viyz_1 {width:381px;height:23px;margin:5px;border-radius:2px;background:#3a083a;border:1px solid #b3a0b2;box-shadow:inset 3px 3px 0 rgba(0,0,0,.5)}._code-panel__input-field_1viyz_1 {display:block;background:transparent;color:#fff;padding:.4em;border:none;width:100%}" , "" ] ) ;
9929
+ exports . push ( [ module . id , "._code-panel_1pe78_3 {position:absolute;left:10px;top:-32px;width:391px;height:32px;margin:0 auto;border-radius:6px 6px 0 0;background:#3d1b3c;z-index:1 }._code-panel__input-wrapp_1pe78_1 {width:381px;height:23px;margin:5px;border-radius:2px;background:#3a083a;border:1px solid #b3a0b2;box-shadow:inset 3px 3px 0 rgba(0,0,0,.5)}._code-panel__input-field_1pe78_1 {display:block;background:transparent;color:#fff;padding:.4em;border:none;width:100%}" , "" ] ) ;
9907
9930
9908
9931
// exports
9909
9932
@@ -10183,7 +10206,7 @@ return /******/ (function(modules) { // webpackBootstrap
10183
10206
'disconnected' : false ,
10184
10207
'asymmetric' : false
10185
10208
} ;
10186
- _this . buttons [ state . type ] = true ;
10209
+ _this . buttons [ state . type || 'straight' ] = true ;
10187
10210
} ;
10188
10211
10189
10212
this . getClass = function ( ) {
@@ -10345,6 +10368,82 @@ return /******/ (function(modules) { // webpackBootstrap
10345
10368
// exports
10346
10369
10347
10370
10371
+ /***/ } ,
10372
+ /* 135 */
10373
+ /***/ function ( module , exports , __webpack_require__ ) {
10374
+
10375
+ /* WEBPACK VAR INJECTION */ ( function ( riot ) {
10376
+ riot . tag2 ( 'little-handle' , '' , '' , 'class="{this.CLASSES[\'little-handle\']}" riot-style="{this.getStyle()}"' , function ( opts ) {
10377
+ 'use strict' ;
10378
+
10379
+ var _this = this ;
10380
+
10381
+ this . CLASSES = __webpack_require__ ( 138 ) ;
10382
+ __webpack_require__ ( 136 ) ;
10383
+
10384
+ this . getStyle = function ( ) {
10385
+ // const {resize} = store.getState(),
10386
+ // x = clamp(this.point.x + this.point.tempX, 0, 100),
10387
+ // cleanX = x * resize.scalerX;
10388
+
10389
+ // let y = this.point.y + this.point.tempY;
10390
+ var x = _this . x + _this . tempX ,
10391
+ y = _this . y + _this . tempY ;
10392
+
10393
+ var translate = 'transform: translate(' + x + 'px, ' + y + 'px)' ;
10394
+ return '' + mojs . h . prefix . css + translate + '; ' + translate ;
10395
+ } ;
10396
+ } ) ;
10397
+ /* WEBPACK VAR INJECTION */ } . call ( exports , __webpack_require__ ( 2 ) ) )
10398
+
10399
+ /***/ } ,
10400
+ /* 136 */
10401
+ /***/ function ( module , exports , __webpack_require__ ) {
10402
+
10403
+ // style-loader: Adds some css to the DOM by adding a <style> tag
10404
+
10405
+ // load the styles
10406
+ var content = __webpack_require__ ( 137 ) ;
10407
+ if ( typeof content === 'string' ) content = [ [ module . id , content , '' ] ] ;
10408
+ // add the styles to the DOM
10409
+ var update = __webpack_require__ ( 11 ) ( content , { } ) ;
10410
+ if ( content . locals ) module . exports = content . locals ;
10411
+ // Hot Module Replacement
10412
+ if ( true ) {
10413
+ // When the styles change, update the <style> tags
10414
+ if ( ! content . locals ) {
10415
+ module . hot . accept ( 137 , function ( ) {
10416
+ var newContent = __webpack_require__ ( 137 ) ;
10417
+ if ( typeof newContent === 'string' ) newContent = [ [ module . id , newContent , '' ] ] ;
10418
+ update ( newContent ) ;
10419
+ } ) ;
10420
+ }
10421
+ // When the module is disposed, remove the <style> tags
10422
+ module . hot . dispose ( function ( ) { update ( ) ; } ) ;
10423
+ }
10424
+
10425
+ /***/ } ,
10426
+ /* 137 */
10427
+ /***/ function ( module , exports , __webpack_require__ ) {
10428
+
10429
+ exports = module . exports = __webpack_require__ ( 10 ) ( ) ;
10430
+ // imports
10431
+
10432
+
10433
+ // module
10434
+ exports . push ( [ module . id , "._little-handle_xdcpx_3{width:6px;height:6px;background:#ff512f;position:absolute}._little-handle_xdcpx_3:after{content:'';position:absolute;width:200%;height:200%;left:50%;top:50%;margin-left:-100%;margin-top:-100%}" , "" ] ) ;
10435
+
10436
+ // exports
10437
+
10438
+
10439
+ /***/ } ,
10440
+ /* 138 */
10441
+ /***/ function ( module , exports ) {
10442
+
10443
+ module . exports = {
10444
+ "little-handle" : "_little-handle_xdcpx_3"
10445
+ } ;
10446
+
10348
10447
/***/ }
10349
10448
/******/ ] )
10350
10449
} ) ;
0 commit comments