show selected color for start selected at (#1606)
This commit is contained in:
@ -419,7 +419,11 @@ class SceneEntities {
|
|||||||
},
|
},
|
||||||
onMouseLeave: ({ object }) => {
|
onMouseLeave: ({ object }) => {
|
||||||
sceneInfra.highlightCallback([0, 0])
|
sceneInfra.highlightCallback([0, 0])
|
||||||
const parent = getParentGroup(object)
|
const parent = getParentGroup(object, [
|
||||||
|
STRAIGHT_SEGMENT,
|
||||||
|
TANGENTIAL_ARC_TO_SEGMENT,
|
||||||
|
PROFILE_START,
|
||||||
|
])
|
||||||
const isSelected = parent?.userData?.isSelected
|
const isSelected = parent?.userData?.isSelected
|
||||||
colorSegment(object, isSelected ? 0x0000ff : 0xffffff)
|
colorSegment(object, isSelected ? 0x0000ff : 0xffffff)
|
||||||
if ([X_AXIS, Y_AXIS].includes(object?.userData?.type)) {
|
if ([X_AXIS, Y_AXIS].includes(object?.userData?.type)) {
|
||||||
|
@ -115,6 +115,7 @@ export function straightSegment({
|
|||||||
pathToNode,
|
pathToNode,
|
||||||
isSelected: false,
|
isSelected: false,
|
||||||
}
|
}
|
||||||
|
group.name = STRAIGHT_SEGMENT
|
||||||
|
|
||||||
const arrowGroup = createArrowhead(scale)
|
const arrowGroup = createArrowhead(scale)
|
||||||
arrowGroup.position.set(to[0], to[1], 0)
|
arrowGroup.position.set(to[0], to[1], 0)
|
||||||
@ -203,6 +204,7 @@ export function tangentialArcToSegment({
|
|||||||
pathToNode,
|
pathToNode,
|
||||||
isSelected: false,
|
isSelected: false,
|
||||||
}
|
}
|
||||||
|
group.name = TANGENTIAL_ARC_TO_SEGMENT
|
||||||
|
|
||||||
const arrowGroup = createArrowhead(scale)
|
const arrowGroup = createArrowhead(scale)
|
||||||
arrowGroup.position.set(to[0], to[1], 0)
|
arrowGroup.position.set(to[0], to[1], 0)
|
||||||
|
@ -20,6 +20,7 @@ import {
|
|||||||
TANGENTIAL_ARC_TO_SEGMENT,
|
TANGENTIAL_ARC_TO_SEGMENT,
|
||||||
sceneEntitiesManager,
|
sceneEntitiesManager,
|
||||||
getParentGroup,
|
getParentGroup,
|
||||||
|
PROFILE_START,
|
||||||
} from 'clientSideScene/sceneEntities'
|
} from 'clientSideScene/sceneEntities'
|
||||||
import { Mesh } from 'three'
|
import { Mesh } from 'three'
|
||||||
import { AXIS_GROUP, X_AXIS } from 'clientSideScene/sceneInfra'
|
import { AXIS_GROUP, X_AXIS } from 'clientSideScene/sceneInfra'
|
||||||
@ -188,7 +189,11 @@ export async function getEventForSelectWithPoint(
|
|||||||
export function getEventForSegmentSelection(
|
export function getEventForSegmentSelection(
|
||||||
obj: any
|
obj: any
|
||||||
): ModelingMachineEvent | null {
|
): ModelingMachineEvent | null {
|
||||||
const group = getParentGroup(obj)
|
const group = getParentGroup(obj, [
|
||||||
|
STRAIGHT_SEGMENT,
|
||||||
|
TANGENTIAL_ARC_TO_SEGMENT,
|
||||||
|
PROFILE_START,
|
||||||
|
])
|
||||||
const axisGroup = getParentGroup(obj, [AXIS_GROUP])
|
const axisGroup = getParentGroup(obj, [AXIS_GROUP])
|
||||||
if (!group && !axisGroup) return null
|
if (!group && !axisGroup) return null
|
||||||
if (axisGroup?.userData.type === AXIS_GROUP) {
|
if (axisGroup?.userData.type === AXIS_GROUP) {
|
||||||
@ -407,8 +412,8 @@ function updateSceneObjectColors(codeBasedSelections: Selection[]) {
|
|||||||
}
|
}
|
||||||
Object.values(sceneEntitiesManager.activeSegments).forEach((segmentGroup) => {
|
Object.values(sceneEntitiesManager.activeSegments).forEach((segmentGroup) => {
|
||||||
if (
|
if (
|
||||||
![STRAIGHT_SEGMENT, TANGENTIAL_ARC_TO_SEGMENT].includes(
|
![STRAIGHT_SEGMENT, TANGENTIAL_ARC_TO_SEGMENT, PROFILE_START].includes(
|
||||||
segmentGroup?.userData?.type
|
segmentGroup?.name
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user