Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aiAdrian committed Jan 31, 2025
2 parents d5145ac + 058eb28 commit a767907
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.9.20"
".": "2.9.21"
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [2.9.21](https://github.com/SchweizerischeBundesbahnen/netzgrafik-editor-frontend/compare/netzgrafik-frontend-v2.9.20...netzgrafik-frontend-v2.9.21) (2025-01-28)


### Bug Fixes

* aemit operations for position transformation service ([#400](https://github.com/SchweizerischeBundesbahnen/netzgrafik-editor-frontend/issues/400)) ([a7dae9e](https://github.com/SchweizerischeBundesbahnen/netzgrafik-editor-frontend/commit/a7dae9ef2f71e32238c3015d1ae4165dfd0d7bf8))

## [2.9.20](https://github.com/SchweizerischeBundesbahnen/netzgrafik-editor-frontend/compare/netzgrafik-frontend-v2.9.19...netzgrafik-frontend-v2.9.20) (2025-01-15)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"extract-i18n": "ng extract-i18n"
},
"name": "netzgrafik-frontend",
"version": "2.9.20",
"version": "2.9.21",
"repository": {
"type": "git",
"url": "https://github.com/SchweizerischeBundesbahnen/netzgrafik-editor-frontend.git"
Expand Down
3 changes: 3 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {Operation} from "./models/operation.model";
import {LabelService} from "./services/data/label.service";
import {NodeService} from "./services/data/node.service";
import {I18nService} from "./core/i18n/i18n.service";
import {PositionTransformationService} from "./services/util/position.transformation.service";

@Component({
selector: "sbb-root",
Expand Down Expand Up @@ -46,6 +47,7 @@ export class AppComponent {
private trainrunService: TrainrunService,
private trainrunSectionService: TrainrunSectionService,
private nodeService: NodeService,
private positionTransformationService: PositionTransformationService,
private labelService: LabelService,
private i18nService: I18nService,
) {
Expand Down Expand Up @@ -86,6 +88,7 @@ export class AppComponent {
this.trainrunService.operation,
this.trainrunSectionService.operation,
this.nodeService.operation,
this.positionTransformationService.operation,
this.labelService.operation,
);
}
8 changes: 7 additions & 1 deletion src/app/services/util/position.transformation.service.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {Injectable} from "@angular/core";
import {EventEmitter, Injectable} from "@angular/core";
import {TrainrunSectionService} from "../data/trainrunsection.service";
import {UiInteractionService} from "../ui/ui.interaction.service";
import {NodeService} from "../data/node.service";
import {NoteService} from "../data/note.service";
import {Vec2D} from "../../utils/vec2D";
import {Node} from "../../models/node.model";
import {ViewportCullService} from "../ui/viewport.cull.service";
import {NodeOperation, Operation, OperationType} from "src/app/models/operation.model";

@Injectable({
providedIn: "root",
Expand All @@ -19,6 +20,7 @@ export class PositionTransformationService {
private readonly viewportCullService: ViewportCullService,
) {
}
readonly operation = new EventEmitter<Operation>();

private scaleFullNetzgrafikArea(factor: number, zoomCenter: Vec2D, windowViewboxPropertiesMapKey: string) {
const scaleCenterCoordinates: Vec2D = this.computeScaleCenterCoordinates(zoomCenter, windowViewboxPropertiesMapKey);
Expand Down Expand Up @@ -135,6 +137,7 @@ export class PositionTransformationService {
if (leftX !== undefined) {
nodes.forEach((n) => {
n.setPosition(leftX, n.getPositionY());
this.operation.emit(new NodeOperation(OperationType.update, n));
});
}

Expand All @@ -157,6 +160,7 @@ export class PositionTransformationService {
if (rightX !== undefined) {
nodes.forEach((n) => {
n.setPosition(rightX - n.getNodeWidth(), n.getPositionY());
this.operation.emit(new NodeOperation(OperationType.update, n));
});
}

Expand All @@ -179,6 +183,7 @@ export class PositionTransformationService {
if (topY !== undefined) {
nodes.forEach((n) => {
n.setPosition(n.getPositionX(), topY);
this.operation.emit(new NodeOperation(OperationType.update, n));
});
}

Expand All @@ -201,6 +206,7 @@ export class PositionTransformationService {
if (bottomY !== undefined) {
nodes.forEach((n) => {
n.setPosition(n.getPositionX(), bottomY - n.getNodeHeight());
this.operation.emit(new NodeOperation(OperationType.update, n));
});
}

Expand Down

0 comments on commit a767907

Please sign in to comment.