Skip to content

Commit e3b57e5

Browse files
authored
557 bug timeslider and graphical time table main view are not well aligned y axis (#559)
* zoom factor fixes the "operating system" screen scaling * correct position of the Show All Locks in the pearlsview
1 parent 1576e99 commit e3b57e5

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

src/app/perlenkette/perlenkette.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'pointer-events: none; margin: 0px; position: absolute; padding-left: ' +
66
(contentWidth - 55) +
77
'px; padding-top: ' +
8-
(contentHeight - 40) +
8+
getPositionY() +
99
'px;'
1010
"
1111
>
@@ -36,7 +36,7 @@
3636
<div
3737
id="textbox"
3838
(click)="trainrunNameClicked($event)"
39-
[attr.style]="'width:' + (contentWidth - 80) + 'px;float: left;'"
39+
[attr.style]="'width:' + (contentWidth - 90) + 'px;float: left;'"
4040
>
4141
<ng-container *ngIf="showTrainrunName()">
4242
<p class="alignleft trainname" (click)="trainrunNameClicked($event)">

src/app/perlenkette/perlenkette.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ export class PerlenketteComponent implements AfterContentChecked, OnDestroy {
331331
return this.versionControlService.getVariantIsWritable();
332332
}
333333

334+
getPositionY(): number {
335+
return this.contentHeight * window.devicePixelRatio - 40;
336+
}
337+
334338
disableSectionView() {
335339
if (!this.getVariantIsWritable()) {
336340
this.signalIsBeingEdited(undefined);

src/app/view/filter-main-side-view/filter-main-side-view.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<sbb-editor-main-view></sbb-editor-main-view>
2424
</ng-container>
2525
<ng-container *ngIf="isStreckengrafik()">
26-
<sbb-streckengrafik></sbb-streckengrafik>
26+
<sbb-streckengrafik [style]="correctZoomFactor()"></sbb-streckengrafik>
2727
</ng-container>
2828
<ng-container *ngIf="isOriginDestination()">
2929
<sbb-origin-destination></sbb-origin-destination>

src/app/view/filter-main-side-view/filter-main-side-view.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,13 @@ export class FilterMainSideViewComponent implements OnInit, OnDestroy {
199199
isOriginDestination() {
200200
return this.mainViewMode === MainViewMode.OriginDestination;
201201
}
202+
203+
correctZoomFactor(): string {
204+
// Empirical observation: For devicePixelRatio of 1.5, no zoom adjustment is needed.
205+
// The reason is unclear, but tests confirm this works reliably.
206+
if (window.devicePixelRatio === 1.5) {
207+
return "";
208+
}
209+
return "zoom: 1.0;";
210+
}
202211
}

0 commit comments

Comments
 (0)