Fixed track view align
*Fixed user being able to align the view on bezier tracks
This commit is contained in:
parent
7ffdf87409
commit
85eeca11f9
@ -5,7 +5,7 @@ import {ElectrificationStatus} from "../../../model/electrification-status";
|
||||
import MiscHelper from "../../../helpers/miscHelper";
|
||||
import {setHoveredTrack, unsetHoveredTrack} from "../../../services/trackHoverInfoService";
|
||||
import GradientsContext from "../../../contexts/GradientsContext";
|
||||
import { TrackSource } from "../../../model/tracks/track";
|
||||
import { TrackShape, TrackSource } from "../../../model/tracks/track";
|
||||
import {useZoomPanEmitter} from "../../../hooks/useZoomPubSub";
|
||||
|
||||
export default function TrackRenderer(props) {
|
||||
@ -46,8 +46,7 @@ function StatelessTrackRenderer(props) {
|
||||
};
|
||||
|
||||
const onClick = (event) => {
|
||||
if (object.r !== 0) return;
|
||||
if (event.detail === 2) {
|
||||
if (object.shape === TrackShape.STRAIGHT && event.detail === 2) {
|
||||
event.preventDefault();
|
||||
onAlign(event);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import Constants from "../../../helpers/constants";
|
||||
import { QuestionMarkIcon, SlopeIcon, SpeedIcon, HashIcon, LightningIcon, RadiusIcon } from "../../../icons";
|
||||
import { TrackShape } from "../../../model/tracks/track";
|
||||
import TrackHoverInfoConsts from "./TrackHoverInfoConsts";
|
||||
|
||||
export default function TrackHoverInfoPopup(props) {
|
||||
@ -10,7 +11,7 @@ export default function TrackHoverInfoPopup(props) {
|
||||
Math.abs(track.end_slope).toFixed(1),
|
||||
]));
|
||||
const slopeOptions = {join: ' / ', subOptions: {suffix: ' ‰'}};
|
||||
const showAlignHint = track.r === 0;
|
||||
const showAlignHint = track.shape === TrackShape.STRAIGHT;
|
||||
|
||||
return (
|
||||
<div className="track-hover-info-popup">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user