Skip to content

Commit

Permalink
Fix scale bar text position when there is no ticks
Browse files Browse the repository at this point in the history
  • Loading branch information
mthh committed Sep 16, 2024
1 parent 3cb5126 commit d0d99a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/LayoutFeatureRenderer/ScaleBarRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const getTickValues = (distance: number) => {

function SimpleLineScaleBar(props: ScaleBar): JSX.Element {
return <>
<g stroke="black" stroke-width={1}>
<g stroke={props.label.fontColor} stroke-width={1}>
<line
x1={initialPosition}
y1={initialPosition + 20}
Expand All @@ -78,7 +78,7 @@ function SimpleLineScaleBar(props: ScaleBar): JSX.Element {
<g>
<text
x={initialPosition + props.width / 2}
y={props.labelPosition === 'top' ? initialPosition : initialPosition + 40}
y={initialPosition + 10}
text-anchor="middle"
dominant-baseline={props.labelPosition === 'top' ? 'auto' : 'hanging'}
style={{ 'user-select': 'none' }}
Expand Down

0 comments on commit d0d99a3

Please sign in to comment.