MCPcopy
hub / github.com/midrender/revideo / selectionStrength

Method selectionStrength

packages/2d/src/lib/components/CodeBlock.ts:437–452  ·  view source on GitHub ↗
(x: number, y: number)

Source from the content-addressed store, hash-verified

435 }
436
437 protected selectionStrength(x: number, y: number): number {
438 const selection = this.selection();
439 const selectionProgress = this.selectionProgress();
440
441 const isSelected = CodeBlock.selectionStrength(selection, x, y);
442 if (selectionProgress === null || this.oldSelection === null) {
443 return isSelected ? 1 : 0;
444 }
445
446 const wasSelected = CodeBlock.selectionStrength(this.oldSelection, x, y);
447 if (isSelected === wasSelected) {
448 return isSelected;
449 }
450
451 return map(wasSelected, isSelected, selectionProgress);
452 }
453
454 protected static selectionStrength(
455 selection: CodeRange[],

Callers 1

getSelectionAlphaMethod · 0.95

Calls 1

mapFunction · 0.90

Tested by

no test coverage detected