Fixed standard signals and map text rendering

*Fixed broken signal icon
*Fixed AlwaysUpText anchor bug
This commit is contained in:
izawartka 2025-08-15 23:32:18 +02:00
parent 0d2580f23e
commit 2f80998a50
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ export default function SignalStandardRenderer(props) {
return (
<g transform={`translate(${x}, ${y}) rotate(${object.rot.y})`}>
<g className="map-icon" transform={`translate(-1.89, -1.89)`}>
<g className="map-icon-stroked" transform={`translate(-1.89, -1.89)`}>
<ReactSVG
src={`${process.env.PUBLIC_URL}/assets/signal.svg`}
wrapper='svg'

View File

@ -13,7 +13,7 @@ export default function AlwaysUpText(props) {
}, [additionalRot, additionalPreRot, offsetX, offsetY]);
const getTextAnchor = useCallback((upsideDown) => {
return (upsideDown !== reverseAnchor) ? "end" : "start";
return (upsideDown !== (reverseAnchor || false)) ? "end" : "start";
}, [reverseAnchor]);
const update = useCallback((mapRotation) => {
@ -25,7 +25,7 @@ export default function AlwaysUpText(props) {
if (!textProps?.textAnchor) {
textRef.current.setAttribute("text-anchor", getTextAnchor(upsideDown));
}
}, [baseRot, getTransformString, getTextAnchor, textProps?.textAnchor]);
}, [baseRot, getTransformString, getTextAnchor, textProps]);
useEffect(() => {
const subscription = mapRotation$.subscribe(rotation => {