@@ -21,13 +21,12 @@ import {defaultRegionSelectColor, defaultRegionSelectStyle} from '../DrawLayerCn
2121
2222/**
2323 * enum
24- * ROTATE is the symbol mainly used as an indication for rotation in drawing layer
2524 * one of 'X','SQUARE','CROSS','DIAMOND','DOT','CIRCLE', 'SQUARE_X', 'EMP_CROSS','EMP_SQUARE_X', 'BOXCIRCLE', 'ARROW'
2625 * */
2726export const DrawSymbol = new Enum ( [
2827 'X' , 'SQUARE' , 'CROSS' , 'DIAMOND' , 'DOT' , 'CIRCLE' , 'SQUARE_X' , 'EMP_CROSS' , 'EMP_SQUARE_X' ,
2928 'BOXCIRCLE' , 'ARROW' , 'ROTATE'
30- ] ) ;
29+ ] , { ignoreCase : true } ) ;
3130
3231export const POINT_DATA_OBJ = 'PointDataObj' ;
3332const DEFAULT_SIZE = 4 ;
@@ -70,7 +69,8 @@ var draw= {
7069
7170 usePathOptimization ( drawObj ) {
7271 if ( ! drawObj . symbol ) return true ;
73- return drawObj . symbol != DrawSymbol . EMP_CROSS && drawObj . symbol != DrawSymbol . EMP_SQUARE_X ;
72+ const s = DrawSymbol . get ( drawObj . symbol ) ;
73+ return s !== DrawSymbol . EMP_CROSS && s !== DrawSymbol . EMP_SQUARE_X ;
7474 } ,
7575
7676 getCenterPt ( drawObj ) { return drawObj . pt ; } ,
@@ -125,7 +125,7 @@ export default {make,draw};
125125
126126/**
127127 * translate the point symbol
128- * @param plot
128+ * @param { WebPlot } plot
129129 * @param drawObj
130130 * @param apt
131131 * @returns {{pt: *} }
@@ -139,10 +139,10 @@ function translatePtTo(plot, drawObj, apt) {
139139/**
140140 * rotate the point symbol (rotate the point defined for the point, not the entire symbol)
141141 * if the entire symbol needs to be rotated, set the angle to renderOptions.rotAngle externally
142- * @param plot
142+ * @param { WebPlot } plot
143143 * @param drawObj
144- * @param angle in screen coodinate direction, radian
145- * @param worldPt
144+ * @param { number } angle in screen coodinate direction, radian
145+ * @param { WorldPt } worldPt
146146 * @returns {{pt: *} }
147147 */
148148function rotatePtAround ( plot , drawObj , angle , worldPt ) {
@@ -153,14 +153,14 @@ function rotatePtAround(plot, drawObj, angle, worldPt) {
153153
154154
155155function makeDrawParams ( pointDataObj , def ) {
156- var symbol = pointDataObj . symbol || def . symbol || DEFAULT_SYMBOL ;
157- var size = ( symbol === DrawSymbol . DOT ) ? pointDataObj . size || def . size || DOT_DEFAULT_SIZE :
156+ const symbol = DrawSymbol . get ( pointDataObj . symbol || def . symbol || DEFAULT_SYMBOL ) ;
157+ const size = ( symbol === DrawSymbol . DOT ) ? pointDataObj . size || def . size || DOT_DEFAULT_SIZE :
158158 pointDataObj . size || def . size || DEFAULT_SIZE ;
159- var fontName = pointDataObj . fontName || def . fontName || 'helvetica' ;
160- var fontSize = pointDataObj . fontSize || def . fontSize || DEFAULT_FONT_SIZE ;
161- var fontWeight = pointDataObj . fontWeight || def . fontWeight || 'normal' ;
162- var fontStyle = pointDataObj . fontStyle || def . fontStyle || 'normal' ;
163- var textLoc = pointDataObj . textLoc || def . textLoc || TextLocation . DEFAULT ;
159+ const fontName = pointDataObj . fontName || def . fontName || 'helvetica' ;
160+ const fontSize = pointDataObj . fontSize || def . fontSize || DEFAULT_FONT_SIZE ;
161+ const fontWeight = pointDataObj . fontWeight || def . fontWeight || 'normal' ;
162+ const fontStyle = pointDataObj . fontStyle || def . fontStyle || 'normal' ;
163+ const textLoc = pointDataObj . textLoc || def . textLoc || TextLocation . DEFAULT ;
164164
165165 return {
166166 color : DrawUtil . getColor ( pointDataObj . color , def . color ) ,
@@ -179,7 +179,7 @@ function makeDrawParams(pointDataObj,def) {
179179 * @param ctx
180180 * @param drawTextAry
181181 * @param pt
182- * @param plot
182+ * @param { WebPlot } plot
183183 * @param drawObj
184184 * @param drawParams
185185 * @param renderOptions
0 commit comments