Fixed standard signals and map text rendering
*Fixed broken signal icon *Fixed AlwaysUpText anchor bug
This commit is contained in:
parent
0d2580f23e
commit
2f80998a50
@ -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'
|
||||
|
||||
@ -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 => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user