aabb collision for selection is back, remove old point in square algorithm and now selected gates are moved on top
This commit is contained in:
parent
b109519cb5
commit
5361fa4190
3 changed files with 15 additions and 16 deletions
src/modules/simulationRenderer/classes
|
@ -2,10 +2,7 @@ import { Camera } from './Camera'
|
|||
import { Simulation } from '../../simulation/classes/Simulation'
|
||||
import { Subject } from 'rxjs'
|
||||
import { MouseEventInfo } from '../../core/components/MouseEventInfo'
|
||||
import {
|
||||
oldPointInSquare,
|
||||
pointInSquare
|
||||
} from '../../../common/math/helpers/pointInSquare'
|
||||
import { pointInSquare } from '../../../common/math/helpers/pointInSquare'
|
||||
import { vector2 } from '../../../common/math/types/vector2'
|
||||
import { relativeTo, add, invert } from '../../vector2/helpers/basic'
|
||||
import { SimulationRendererOptions } from '../types/SimulationRendererOptions'
|
||||
|
@ -232,6 +229,16 @@ export class SimulationRenderer {
|
|||
|
||||
for (const { id } of selectedGates) {
|
||||
addIdToSelection(this, 'permanent', id)
|
||||
|
||||
const node = this.simulation.gates.get(id)
|
||||
|
||||
if (node) {
|
||||
this.simulation.gates.moveOnTop(node)
|
||||
} else {
|
||||
throw new SimulationError(
|
||||
`Cannot find node in gate storage with id ${id}`
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue