Skip to content
Snippets Groups Projects
Commit c9c2bb50 authored by Xiao Gui's avatar Xiao Gui
Browse files

bugfix: minimap on startup

bugfix: on new ATP, reset panel mode
bugfix: scale bar position
fix tests
parent 31b81439
No related branches found
No related tags found
No related merge requests found
...@@ -76,7 +76,7 @@ export class NehubaViewerUnit implements OnDestroy { ...@@ -76,7 +76,7 @@ export class NehubaViewerUnit implements OnDestroy {
@Output() public nehubaReady: EventEmitter<null> = new EventEmitter() @Output() public nehubaReady: EventEmitter<null> = new EventEmitter()
@Output() public layersChanged: EventEmitter<null> = new EventEmitter() @Output() public layersChanged: EventEmitter<null> = new EventEmitter()
private layersChangedHandler: any private layersChangedHandler: any
@Output() public viewerPositionChange: EventEmitter<{ orientation: number[], perspectiveOrientation: number[], perspectiveZoom: number, zoom: number, position: number[], positionReal: boolean }> = new EventEmitter() @Output() public viewerPositionChange: EventEmitter<{ orientation: number[], perspectiveOrientation: number[], perspectiveZoom: number, zoom: number, position: number[], positionReal?: boolean }> = new EventEmitter()
@Output() public mouseoverSegmentEmitter: @Output() public mouseoverSegmentEmitter:
EventEmitter<{ EventEmitter<{
segmentId: number | null segmentId: number | null
......
...@@ -25,6 +25,12 @@ const makeCol = (...els: HTMLElement[]) => { ...@@ -25,6 +25,12 @@ const makeCol = (...els: HTMLElement[]) => {
return container return container
} }
const washPanels = (panels: [HTMLElement, HTMLElement, HTMLElement, HTMLElement]) => {
for (const panel of panels) {
if (panel) { panel.className = `position-relative` }
}
return panels
}
const top = true const top = true
const left = true const left = true
...@@ -101,6 +107,7 @@ export const addTouchSideClasses = (panel: HTMLElement, actualOrderIndex: number ...@@ -101,6 +107,7 @@ export const addTouchSideClasses = (panel: HTMLElement, actualOrderIndex: number
} }
export const getHorizontalOneThree = (panels: [HTMLElement, HTMLElement, HTMLElement, HTMLElement]): HTMLElement => { export const getHorizontalOneThree = (panels: [HTMLElement, HTMLElement, HTMLElement, HTMLElement]): HTMLElement => {
washPanels(panels)
panels.forEach((panel, idx) => addTouchSideClasses(panel, idx, "H_ONE_THREE")) panels.forEach((panel, idx) => addTouchSideClasses(panel, idx, "H_ONE_THREE"))
...@@ -114,6 +121,7 @@ export const getHorizontalOneThree = (panels: [HTMLElement, HTMLElement, HTMLEle ...@@ -114,6 +121,7 @@ export const getHorizontalOneThree = (panels: [HTMLElement, HTMLElement, HTMLEle
} }
export const getVerticalOneThree = (panels: [HTMLElement, HTMLElement, HTMLElement, HTMLElement]): HTMLDivElement => { export const getVerticalOneThree = (panels: [HTMLElement, HTMLElement, HTMLElement, HTMLElement]): HTMLDivElement => {
washPanels(panels)
panels.forEach((panel, idx) => addTouchSideClasses(panel, idx, "V_ONE_THREE")) panels.forEach((panel, idx) => addTouchSideClasses(panel, idx, "V_ONE_THREE"))
...@@ -127,6 +135,7 @@ export const getVerticalOneThree = (panels: [HTMLElement, HTMLElement, HTMLEleme ...@@ -127,6 +135,7 @@ export const getVerticalOneThree = (panels: [HTMLElement, HTMLElement, HTMLEleme
} }
export const getFourPanel = (panels: [HTMLElement, HTMLElement, HTMLElement, HTMLElement]): HTMLDivElement => { export const getFourPanel = (panels: [HTMLElement, HTMLElement, HTMLElement, HTMLElement]): HTMLDivElement => {
washPanels(panels)
panels.forEach((panel, idx) => addTouchSideClasses(panel, idx, "FOUR_PANEL")) panels.forEach((panel, idx) => addTouchSideClasses(panel, idx, "FOUR_PANEL"))
...@@ -140,10 +149,14 @@ export const getFourPanel = (panels: [HTMLElement, HTMLElement, HTMLElement, HTM ...@@ -140,10 +149,14 @@ export const getFourPanel = (panels: [HTMLElement, HTMLElement, HTMLElement, HTM
} }
export const getSinglePanel = (panels: [HTMLElement, HTMLElement, HTMLElement, HTMLElement]): HTMLDivElement => { export const getSinglePanel = (panels: [HTMLElement, HTMLElement, HTMLElement, HTMLElement]): HTMLDivElement => {
washPanels(panels)
return getFullViewPanel(panels) return getFullViewPanel(panels)
} }
export const getPipPanel = (panels: [HTMLElement, HTMLElement, HTMLElement, HTMLElement]): HTMLDivElement => { export const getPipPanel = (panels: [HTMLElement, HTMLElement, HTMLElement, HTMLElement]): HTMLDivElement => {
washPanels(panels)
return getFullViewPanel(panels) return getFullViewPanel(panels)
} }
......
import { Injectable } from "@angular/core";
import { createEffect } from "@ngrx/effects";
import { Store } from "@ngrx/store";
import { mapTo } from "rxjs/operators";
import { atlasSelection, userInterface } from "src/state";
@Injectable()
export class ViewerCtrlEffects {
onTemplateChangeResetLayout$ = createEffect(() => this.store$.pipe(
atlasSelection.fromRootStore.distinctATP(),
mapTo(userInterface.actions.setPanelMode({
panelMode: "FOUR_PANEL"
}))
))
constructor(private store$: Store){}
}
...@@ -8,6 +8,8 @@ import { ViewerCtrlCmp } from "./viewerCtrlCmp/viewerCtrlCmp.component"; ...@@ -8,6 +8,8 @@ import { ViewerCtrlCmp } from "./viewerCtrlCmp/viewerCtrlCmp.component";
import { PerspectiveViewSlider } from "./perspectiveViewSlider/perspectiveViewSlider.component"; import { PerspectiveViewSlider } from "./perspectiveViewSlider/perspectiveViewSlider.component";
import { SnapPerspectiveOrientationCmp } from "src/viewerModule/nehuba/viewerCtrl/snapPerspectiveOrientation/snapPerspectiveOrientation.component"; import { SnapPerspectiveOrientationCmp } from "src/viewerModule/nehuba/viewerCtrl/snapPerspectiveOrientation/snapPerspectiveOrientation.component";
import { WindowResizeModule } from "src/util/windowResize"; import { WindowResizeModule } from "src/util/windowResize";
import { EffectsModule } from "@ngrx/effects";
import { ViewerCtrlEffects } from "./effects"
@NgModule({ @NgModule({
imports: [ imports: [
...@@ -18,6 +20,9 @@ import { WindowResizeModule } from "src/util/windowResize"; ...@@ -18,6 +20,9 @@ import { WindowResizeModule } from "src/util/windowResize";
ReactiveFormsModule, ReactiveFormsModule,
ComponentsModule, ComponentsModule,
WindowResizeModule, WindowResizeModule,
EffectsModule.forFeature([
ViewerCtrlEffects
])
], ],
declarations: [ declarations: [
ViewerCtrlCmp, ViewerCtrlCmp,
......
...@@ -193,7 +193,10 @@ export class PerspectiveViewSlider implements OnDestroy { ...@@ -193,7 +193,10 @@ export class PerspectiveViewSlider implements OnDestroy {
public sliceviewIsNormal$ = this.store$.pipe( public sliceviewIsNormal$ = this.store$.pipe(
select(atlasSelection.selectors.navigation), select(atlasSelection.selectors.navigation),
map(navigation => [0, 0, 0, 1].every((v, idx) => floatEquality(navigation.orientation[idx], v, 1e-3))) map(navigation => {
// if navigation in store is nullish, assume starting position, ie slice view is normal
if (!navigation) return true
return [0, 0, 0, 1].every((v, idx) => floatEquality(navigation.orientation[idx], v, 1e-3))})
) )
public textToDisplay$ = combineLatest([ public textToDisplay$ = combineLatest([
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment