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

Method doClip

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

* @function LevelRenderer.Shape.prototype.doClip *

(ctx)

Source from the content-addressed store, hash-verified

389 *
390 */
391 doClip(ctx) {
392 var clipShapeInvTransform = SUtil.Util_matrix.create();
393
394 if (this.__clipShapes) {
395 for (var i = 0; i < this.__clipShapes.length; i++) {
396 var clipShape = this.__clipShapes[i];
397 if (clipShape.needTransform) {
398 let m = clipShape.transform;
399 SUtil.Util_matrix.invert(clipShapeInvTransform, m);
400 ctx.transform(
401 m[0], m[1],
402 m[2], m[3],
403 m[4], m[5]
404 );
405 }
406 ctx.beginPath();
407 clipShape.buildPath(ctx, clipShape.style);
408 ctx.clip();
409 // Transform back
410 if (clipShape.needTransform) {
411 let m = clipShapeInvTransform;
412 ctx.transform(
413 m[0], m[1],
414 m[2], m[3],
415 m[4], m[5]
416 );
417 }
418 }
419 }
420 }
421
422
423 /**

Callers 4

beforeBrushMethod · 0.95
ShapeSpec.jsFile · 0.80
brushMethod · 0.80
brushMethod · 0.80

Calls 3

invertMethod · 0.80
createMethod · 0.45
buildPathMethod · 0.45

Tested by

no test coverage detected