* fix snapping line being culled * make snap line more grayed out * make snapping tolerance smaller
This commit is contained in:
@ -2672,8 +2672,8 @@ export class SceneEntities {
|
|||||||
if (prev && ARC_SEGMENT_TYPES.includes(prev.userData.type)) {
|
if (prev && ARC_SEGMENT_TYPES.includes(prev.userData.type)) {
|
||||||
const snapDirection = findTangentDirection(prev)
|
const snapDirection = findTangentDirection(prev)
|
||||||
if (snapDirection) {
|
if (snapDirection) {
|
||||||
const SNAP_TOLERANCE_PIXELS = 12 * window.devicePixelRatio
|
const SNAP_TOLERANCE_PIXELS = 8 * window.devicePixelRatio
|
||||||
const SNAP_MIN_DISTANCE_PIXELS = 5 * window.devicePixelRatio
|
const SNAP_MIN_DISTANCE_PIXELS = 10 * window.devicePixelRatio
|
||||||
const orthoFactor = orthoScale(this.sceneInfra.camControls.camera)
|
const orthoFactor = orthoScale(this.sceneInfra.camControls.camera)
|
||||||
|
|
||||||
// See if snapDirection intersects with any of the axes
|
// See if snapDirection intersects with any of the axes
|
||||||
|
@ -221,7 +221,7 @@ class StraightSegment implements SegmentUtils {
|
|||||||
const snapLine = createLine({
|
const snapLine = createLine({
|
||||||
from: [0, 0],
|
from: [0, 0],
|
||||||
to: [0, 0],
|
to: [0, 0],
|
||||||
color: 0xcccccc,
|
color: 0x555555,
|
||||||
})
|
})
|
||||||
snapLine.name = STRAIGHT_SEGMENT_SNAP_LINE
|
snapLine.name = STRAIGHT_SEGMENT_SNAP_LINE
|
||||||
segmentGroup.add(snapLine)
|
segmentGroup.add(snapLine)
|
||||||
@ -294,6 +294,8 @@ class StraightSegment implements SegmentUtils {
|
|||||||
if (snapLine) {
|
if (snapLine) {
|
||||||
snapLine.visible = !!input.snap
|
snapLine.visible = !!input.snap
|
||||||
if (snapLine.visible) {
|
if (snapLine.visible) {
|
||||||
|
// Without this three.js incorrectly culls the line in some cases when zoomed in too much
|
||||||
|
snapLine.frustumCulled = false
|
||||||
const snapLineFrom = to
|
const snapLineFrom = to
|
||||||
const snapLineTo = new Vector3(to[0], to[1], 0).addScaledVector(
|
const snapLineTo = new Vector3(to[0], to[1], 0).addScaledVector(
|
||||||
dir,
|
dir,
|
||||||
|
Reference in New Issue
Block a user