feat(effects): add Darkness action effect like freeze
Adds a fullscreen darkness vignette on click and a permanent shadow spot with a black radial gradient (40% edge, 100% center). Includes control panel UI, i18n, eraser support, and tests. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -43,13 +43,15 @@ export function minDistSqEffectToPoint(inst: EffectInstance, p: { x: number; y:
|
||||
case 'lightning':
|
||||
case 'sunbeam':
|
||||
return distSqPointToSegment(p.x, p.y, inst.start.x, inst.start.y, inst.end.x, inst.end.y);
|
||||
case 'freeze': {
|
||||
case 'freeze':
|
||||
case 'darkness': {
|
||||
const dx = inst.at.x - p.x;
|
||||
const dy = inst.at.y - p.y;
|
||||
return dx * dx + dy * dy;
|
||||
}
|
||||
case 'scorch':
|
||||
case 'ice':
|
||||
case 'shadow':
|
||||
case 'poisonCloud': {
|
||||
const dx = inst.at.x - p.x;
|
||||
const dy = inst.at.y - p.y;
|
||||
@@ -61,7 +63,7 @@ export function minDistSqEffectToPoint(inst: EffectInstance, p: { x: number; y:
|
||||
}
|
||||
|
||||
function eraseHitThresholdSq(inst: EffectInstance, toolRadiusN: number): number {
|
||||
if (inst.type === 'scorch' || inst.type === 'ice' || inst.type === 'poisonCloud') {
|
||||
if (inst.type === 'scorch' || inst.type === 'ice' || inst.type === 'shadow' || inst.type === 'poisonCloud') {
|
||||
const r = toolRadiusN + inst.radiusN;
|
||||
return r * r;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user