MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / beforeBrush

Method beforeBrush

src/common/overlay/levelRenderer/Shape.js:307–337  ·  view source on GitHub ↗

* @function LevelRenderer.Shape.prototype.beforeBrush * @description 具体绘制操作前的一些公共操作。 * * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。 * @param {boolean} isHighlight - 是否使用高亮属性。 * @return {Object} 处理后的样式。

(ctx, isHighlight)

Source from the content-addressed store, hash-verified

305 * @return {Object} 处理后的样式。
306 */
307 beforeBrush(ctx, isHighlight) {
308 var style = this.style;
309
310 if (this.brushTypeOnly) {
311 style.brushType = this.brushTypeOnly;
312 }
313
314 if (isHighlight) {
315 // 根据style扩展默认高亮样式
316 style = this.getHighlightStyle(
317 style,
318 this.highlightStyle || {},
319 this.brushTypeOnly
320 );
321 }
322
323 if (this.brushTypeOnly == 'stroke') {
324 style.strokeColor = style.strokeColor || style.color;
325 }
326
327 ctx.save();
328
329 this.doClip(ctx);
330
331 this.setContext(ctx, style);
332
333 // 设置transform
334 this.setTransform(ctx);
335
336 return style;
337 }
338
339
340 /**

Callers 10

brushMethod · 0.95
ShapeSpec.jsFile · 0.80
echarts-en.min.jsFile · 0.80
echarts.min.jsFile · 0.80
echarts.simple.jsFile · 0.80

Calls 5

getHighlightStyleMethod · 0.95
doClipMethod · 0.95
setContextMethod · 0.95
saveMethod · 0.80
setTransformMethod · 0.80

Tested by

no test coverage detected