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
|
if (!viewport?.element) return false
|
||||||
|
|
||||||
const annotations = getAnnotations(this.getToolName(), viewport.element) || []
|
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
|
if (!crosshairAnnotation) return false
|
||||||
|
|
||||||
const worldPoint = crosshairAnnotation.data?.handles?.points?.[0]
|
const worldPoint = crosshairAnnotation.data?.handles?.points?.[0]
|
||||||
|
|
@ -321,20 +323,9 @@ class FusionJumpToPointTool extends AnnotationDisplayTool {
|
||||||
_getViewportCrosshairAnnotation(viewport) {
|
_getViewportCrosshairAnnotation(viewport) {
|
||||||
if (!viewport?.element) return null
|
if (!viewport?.element) return null
|
||||||
const annotations = getAnnotations(this.getToolName(), viewport.element) || []
|
const annotations = getAnnotations(this.getToolName(), viewport.element) || []
|
||||||
return this._findViewportCrosshairAnnotationFromList(annotations, viewport.id)
|
return annotations.find((item) =>
|
||||||
}
|
item?.data?.type === 'fusion-jump-crosshair' && item?.data?.viewportId === viewport.id
|
||||||
|
) || null
|
||||||
_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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_tryStartDrag(evt) {
|
_tryStartDrag(evt) {
|
||||||
|
|
@ -530,13 +521,8 @@ class FusionJumpToPointTool extends AnnotationDisplayTool {
|
||||||
|
|
||||||
_getReferenceLineColor(viewportId, fallbackColor) {
|
_getReferenceLineColor(viewportId, fallbackColor) {
|
||||||
if (typeof this.configuration.getReferenceLineColor === 'function') {
|
if (typeof this.configuration.getReferenceLineColor === 'function') {
|
||||||
try {
|
const color = this.configuration.getReferenceLineColor(viewportId)
|
||||||
const safeViewportId = viewportId || ''
|
if (color) return color
|
||||||
const color = this.configuration.getReferenceLineColor(safeViewportId)
|
|
||||||
if (color) return color
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return fallbackColor || '#6fb9ff'
|
return fallbackColor || '#6fb9ff'
|
||||||
}
|
}
|
||||||
|
|
@ -552,11 +538,7 @@ class FusionJumpToPointTool extends AnnotationDisplayTool {
|
||||||
const centerHoleSize = Number.isFinite(appearance.centerHoleSize) ? appearance.centerHoleSize : 8
|
const centerHoleSize = Number.isFinite(appearance.centerHoleSize) ? appearance.centerHoleSize : 8
|
||||||
let color = appearance.color
|
let color = appearance.color
|
||||||
if (!color && typeof this.configuration.getReferenceLineColor === 'function') {
|
if (!color && typeof this.configuration.getReferenceLineColor === 'function') {
|
||||||
try {
|
color = this.configuration.getReferenceLineColor(sourceViewportId)
|
||||||
color = this.configuration.getReferenceLineColor(sourceViewportId || '')
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue