预设修改

This commit is contained in:
tianmo committed 2026-09-22 17:17:39 +08:00
1 parent 4f2c980bac
commit abb4ac4acc
4 files changed
+19 -19

No files matched your search

+2 -2
View File
@@ -39,7 +39,7 @@ export class ObjectInteractions {
const sys = this.ctx.store.systems.find((item) => item.id === this.ctx.store.activeId)
if (sys?.visible === false) return false
const cfg = sys?.config
if (!cfg?.forceField || cfg.forceRadius <= 0) return false
if (!cfg?.forceField || !cfg.showForceFieldShape || cfg.forceRadius <= 0) return false
const startPointer = pointerToWorldMath(this.ctx, e.clientX, e.clientY)
const distance = Math.hypot(startPointer.x - cfg.forceCenterX, startPointer.y - cfg.forceCenterY)
if (distance > cfg.forceRadius) return false
@@ -69,7 +69,7 @@ export class ObjectInteractions {
const sys = this.ctx.store.systems.find((item) => item.id === this.ctx.store.activeId)
if (sys?.visible === false) return false
const cfg = sys?.config
if (!cfg?.attraction) return false
if (!cfg?.attraction || !cfg.showAttractionShape) return false
const startPointer = pointerToWorldMath(this.ctx, e.clientX, e.clientY)
const hitRadius = Math.max(cfg.attractionRadius, 12 / Math.max(0.0001, this.ctx.store.editor.viewScale))
const distance = Math.hypot(startPointer.x - cfg.attractionCenterX, startPointer.y - cfg.attractionCenterY)