diff --git a/core/gui/src/app/workspace/component/menu/menu.component.html b/core/gui/src/app/workspace/component/menu/menu.component.html index a3419f2bc16..4f95ccf0835 100644 --- a/core/gui/src/app/workspace/component/menu/menu.component.html +++ b/core/gui/src/app/workspace/component/menu/menu.component.html @@ -138,22 +138,6 @@ nz-icon nzType="border-outer"> - - - -
-
-
+
+ + + +
+
+
+
diff --git a/core/gui/src/app/workspace/component/workflow-editor/mini-map/mini-map.component.scss b/core/gui/src/app/workspace/component/workflow-editor/mini-map/mini-map.component.scss index 5a9b0b26458..4e69c504d02 100644 --- a/core/gui/src/app/workspace/component/workflow-editor/mini-map/mini-map.component.scss +++ b/core/gui/src/app/workspace/component/workflow-editor/mini-map/mini-map.component.scss @@ -1,10 +1,24 @@ #minimap-button { - position: fixed; + position: absolute; bottom: 0; right: 0; z-index: 4; } +#minimap-zoom-out-button { + position: absolute; + bottom: 0; + right: 30px; + z-index: 4; +} + +#minimap-zoom-in-button { + position: absolute; + bottom: 0; + right: 60px; + z-index: 4; +} + #mini-map { height: 200px; width: 300px; diff --git a/core/gui/src/app/workspace/component/workflow-editor/mini-map/mini-map.component.ts b/core/gui/src/app/workspace/component/workflow-editor/mini-map/mini-map.component.ts index 8de83d9b254..88118e82b6f 100644 --- a/core/gui/src/app/workspace/component/workflow-editor/mini-map/mini-map.component.ts +++ b/core/gui/src/app/workspace/component/workflow-editor/mini-map/mini-map.component.ts @@ -3,6 +3,7 @@ import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy"; import { WorkflowActionService } from "../../../service/workflow-graph/model/workflow-action.service"; import { MAIN_CANVAS } from "../workflow-editor.component"; import * as joint from "jointjs"; +import { JointGraphWrapper } from "../../../service/workflow-graph/model/joint-graph-wrapper"; @UntilDestroy() @Component({ @@ -68,4 +69,39 @@ export class MiniMapComponent implements AfterViewInit, OnDestroy { navigator.style.height = (editor.offsetHeight / this.paper.scale().sy) * this.scale + "px"; } } + + public onClickZoomOut(): void { + // if zoom is already at minimum, don't zoom out again. + if (this.workflowActionService.getJointGraphWrapper().isZoomRatioMin()) { + return; + } + + // make the ratio small. + this.workflowActionService + .getJointGraphWrapper() + .setZoomProperty( + this.workflowActionService.getJointGraphWrapper().getZoomRatio() - JointGraphWrapper.ZOOM_CLICK_DIFF + ); + } + + /** + * This method will increase the zoom ratio and send the new zoom ratio value + * to the joint graph wrapper to change overall zoom ratio that is used in + * zoom buttons and mouse wheel zoom. + * + * If the zoom ratio already reaches maximum, this method will not do anything. + */ + public onClickZoomIn(): void { + // if zoom is already reach maximum, don't zoom in again. + if (this.workflowActionService.getJointGraphWrapper().isZoomRatioMax()) { + return; + } + + // make the ratio big. + this.workflowActionService + .getJointGraphWrapper() + .setZoomProperty( + this.workflowActionService.getJointGraphWrapper().getZoomRatio() + JointGraphWrapper.ZOOM_CLICK_DIFF + ); + } }