Compare commits
No commits in common. "27646e2c46ae1e9e0b96ba5497c8520adf33c95b" and "48b154bf87b0de0438a84ca7ad02577dc3335a46" have entirely different histories.
27646e2c46
...
48b154bf87
|
|
@ -194,7 +194,9 @@ class FusionJumpToPointTool extends AnnotationDisplayTool {
|
|||
if (!viewport?.element) return false
|
||||
|
||||
const annotations = getAnnotations(this.getToolName(), viewport.element) || []
|
||||
const crosshairAnnotation = this._findViewportCrosshairAnnotationFromList(annotations, viewport.id)
|
||||
const crosshairAnnotation = annotations.find((item) =>
|
||||
item?.data?.type === 'fusion-jump-crosshair' && item?.data?.viewportId === viewport.id
|
||||
)
|
||||
if (!crosshairAnnotation) return false
|
||||
|
||||
const worldPoint = crosshairAnnotation.data?.handles?.points?.[0]
|
||||
|
|
@ -321,20 +323,9 @@ class FusionJumpToPointTool extends AnnotationDisplayTool {
|
|||
_getViewportCrosshairAnnotation(viewport) {
|
||||
if (!viewport?.element) return null
|
||||
const annotations = getAnnotations(this.getToolName(), viewport.element) || []
|
||||
return this._findViewportCrosshairAnnotationFromList(annotations, viewport.id)
|
||||
}
|
||||
|
||||
_findViewportCrosshairAnnotationFromList(annotations, viewportId) {
|
||||
if (!Array.isArray(annotations) || !viewportId) return null
|
||||
for (let i = 0; i < annotations.length; i++) {
|
||||
const item = annotations[i]
|
||||
const data = item && item.data
|
||||
if (!data) continue
|
||||
if (data.type === 'fusion-jump-crosshair' && data.viewportId === viewportId) {
|
||||
return item
|
||||
}
|
||||
}
|
||||
return null
|
||||
return annotations.find((item) =>
|
||||
item?.data?.type === 'fusion-jump-crosshair' && item?.data?.viewportId === viewport.id
|
||||
) || null
|
||||
}
|
||||
|
||||
_tryStartDrag(evt) {
|
||||
|
|
@ -530,13 +521,8 @@ class FusionJumpToPointTool extends AnnotationDisplayTool {
|
|||
|
||||
_getReferenceLineColor(viewportId, fallbackColor) {
|
||||
if (typeof this.configuration.getReferenceLineColor === 'function') {
|
||||
try {
|
||||
const safeViewportId = viewportId || ''
|
||||
const color = this.configuration.getReferenceLineColor(safeViewportId)
|
||||
if (color) return color
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
const color = this.configuration.getReferenceLineColor(viewportId)
|
||||
if (color) return color
|
||||
}
|
||||
return fallbackColor || '#6fb9ff'
|
||||
}
|
||||
|
|
@ -552,11 +538,7 @@ class FusionJumpToPointTool extends AnnotationDisplayTool {
|
|||
const centerHoleSize = Number.isFinite(appearance.centerHoleSize) ? appearance.centerHoleSize : 8
|
||||
let color = appearance.color
|
||||
if (!color && typeof this.configuration.getReferenceLineColor === 'function') {
|
||||
try {
|
||||
color = this.configuration.getReferenceLineColor(sourceViewportId || '')
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
color = this.configuration.getReferenceLineColor(sourceViewportId)
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Reference in New Issue