@@ -75,7 +75,7 @@ return /******/ (function(modules) { // webpackBootstrap
75
75
/******/ }
76
76
/******/
77
77
/******/ var hotApplyOnUpdate = true ;
78
- /******/ var hotCurrentHash = "4180f42de19836a486f4 " ; // eslint-disable-line no-unused-vars
78
+ /******/ var hotCurrentHash = "94929f4bc804254be486 " ; // eslint-disable-line no-unused-vars
79
79
/******/ var hotCurrentModuleData = { } ;
80
80
/******/ var hotCurrentParents = [ ] ; // eslint-disable-line no-unused-vars
81
81
/******/
@@ -3798,7 +3798,7 @@ return /******/ (function(modules) { // webpackBootstrap
3798
3798
/* WEBPACK VAR INJECTION */ ( function ( riot ) {
3799
3799
__webpack_require__ ( 13 ) ;
3800
3800
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="1 .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="{string }" data-index="{index}" stroke="white" 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 ) {
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 ) {
3802
3802
'use strict' ;
3803
3803
3804
3804
var _this = this ;
@@ -3854,29 +3854,45 @@ return /******/ (function(modules) { // webpackBootstrap
3854
3854
}
3855
3855
3856
3856
var str = '' ;
3857
+ var segmentStr = '' ;
3857
3858
3858
3859
var x = point . x + point . tempX ,
3859
3860
y = point . y + point . tempY ,
3860
3861
xNext = nextPoint . x + nextPoint . tempX ,
3861
3862
yNext = nextPoint . y + nextPoint . tempY ;
3862
3863
3864
+ var part1 = 'M' + x + ', ' + y / _constants2 . default . CURVE_PERCENT + ' ' ;
3863
3865
if ( i === 0 ) {
3864
- str += 'M' + x + ', ' + y / _constants2 . default . CURVE_PERCENT + ' ' ;
3866
+ str += part1 ;
3865
3867
}
3866
- str += getPoint ( point , 2 ) ;
3867
- str += getPoint ( nextPoint , 1 ) ;
3868
- str += xNext + ', ' + yNext / _constants2 . default . CURVE_PERCENT + ' ' ;
3868
+ segmentStr += part1 ;
3869
3869
3870
- return str ;
3870
+ var part2 = getPoint ( point , 2 ) ;
3871
+ str += part2 ;
3872
+ segmentStr += part2 ;
3873
+
3874
+ var part3 = getPoint ( nextPoint , 1 ) ;
3875
+ str += part3 ;
3876
+ segmentStr += part3 ;
3877
+
3878
+ var part4 = xNext + ', ' + yNext / _constants2 . default . CURVE_PERCENT + ' ' ;
3879
+ str += part4 ;
3880
+ segmentStr += part4 ;
3881
+
3882
+ return { str : str , segmentStr : segmentStr } ;
3871
3883
} ;
3872
3884
3873
3885
var getPath = function getPath ( ) {
3874
3886
var str = '' ;
3887
+ _this . segments = [ ] ;
3875
3888
for ( var i = 0 ; i < _this . points . length - 1 ; i ++ ) {
3876
3889
var point = _this . points [ i ] ,
3877
3890
nextPoint = _this . points [ i + 1 ] ;
3878
3891
3879
- str += getSegment ( point , nextPoint , i ) ;
3892
+ var segment = getSegment ( point , nextPoint , i ) ;
3893
+ str += segment . str ;
3894
+ console . log ( i ) ;
3895
+ _this . segments . push ( { index : i , str : segment . segmentStr } ) ;
3880
3896
}
3881
3897
3882
3898
_this . path = str ;
@@ -3902,24 +3918,6 @@ return /******/ (function(modules) { // webpackBootstrap
3902
3918
} ;
3903
3919
} ;
3904
3920
3905
- var getSegments = function getSegments ( ) {
3906
- _this . segments = [ ] ;
3907
- for ( var i = 1 ; i < _this . points . length ; i ++ ) {
3908
- var pPoint = _this . points [ i - 1 ] ,
3909
- point = _this . points [ i ] ,
3910
- px = pPoint . x + pPoint . tempX ,
3911
- py = pPoint . y + pPoint . tempY ,
3912
- x = point . x + point . tempX ,
3913
- y = point . y + point . tempY ;
3914
-
3915
- // const startChar = (i === 1) ? 'M' : 'L'
3916
- _this . segments . push ( {
3917
- index : i ,
3918
- string : 'M' + px + ', ' + py / _constants2 . default . CURVE_PERCENT + ' L' + x + ', ' + y / _constants2 . default . CURVE_PERCENT
3919
- } ) ;
3920
- }
3921
- } ;
3922
-
3923
3921
var getState = function getState ( ) {
3924
3922
_this . state = _store2 . default . getState ( ) ;
3925
3923
} ;
@@ -3930,7 +3928,7 @@ return /******/ (function(modules) { // webpackBootstrap
3930
3928
_this . styles = _this . getStyle ( ) ;
3931
3929
} ;
3932
3930
var get = function get ( ) {
3933
- getState ( ) ; getPoints ( ) ; getSegments ( ) ; getPath ( ) ; getStyles ( ) ;
3931
+ getState ( ) ; getPoints ( ) ; getPath ( ) ; getStyles ( ) ;
3934
3932
} ;
3935
3933
3936
3934
get ( ) ;
@@ -3951,6 +3949,8 @@ return /******/ (function(modules) { // webpackBootstrap
3951
3949
y = ev . offsetY * _constants2 . default . CURVE_PERCENT ,
3952
3950
index = parseInt ( target . getAttribute ( 'data-index' ) ) ;
3953
3951
3952
+ console . log ( index ) ;
3953
+
3954
3954
_store2 . default . dispatch ( {
3955
3955
type : 'POINT_ADD' ,
3956
3956
data : { x : x , y : y , index : index } ,
0 commit comments