Skip to content

Commit

Permalink
fix(grids) Freeze Other Markers (#6704)
Browse files Browse the repository at this point in the history
- `RulerMarkers` now uses the frozen marker data for other row and other
columns.
  • Loading branch information
seanparsons authored Dec 6, 2024
1 parent 7bca70d commit c54189e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions editor/src/components/canvas/controls/grid-controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2455,6 +2455,8 @@ const RulerMarkers = React.memo((props: RulerMarkersProps) => {
return null
}

const frozenOrRegularMarkerData = frozenMarkers ?? rulerMarkerData

return (
<React.Fragment>
<GridRuler
Expand All @@ -2464,7 +2466,7 @@ const RulerMarkers = React.memo((props: RulerMarkersProps) => {
rulerVisible={showExtraMarkers === 'column' ? 'visible' : 'not-visible'}
>
{/* Other markers for unselected tracks */}
{rulerMarkerData.otherColumnMarkers.map((marker, index) => {
{frozenOrRegularMarkerData.otherColumnMarkers.map((marker, index) => {
return (
<RulerMarkerIndicator
key={`ruler-marker-${index}`}
Expand All @@ -2481,7 +2483,7 @@ const RulerMarkers = React.memo((props: RulerMarkersProps) => {
<RulerMarkerIndicator
gridRect={rulerMarkerData.gridRect}
parentGrid={rulerMarkerData.parentGrid}
marker={frozenMarkers?.columnStart ?? rulerMarkerData.columnStart}
marker={frozenOrRegularMarkerData.columnStart}
axis={'column'}
visible={'visible'}
onMouseDown={columnMarkerMouseDown('column-start')}
Expand All @@ -2490,7 +2492,7 @@ const RulerMarkers = React.memo((props: RulerMarkersProps) => {
<RulerMarkerIndicator
gridRect={rulerMarkerData.gridRect}
parentGrid={rulerMarkerData.parentGrid}
marker={frozenMarkers?.columnEnd ?? rulerMarkerData.columnEnd}
marker={frozenOrRegularMarkerData.columnEnd}
axis={'column'}
visible={'visible'}
onMouseDown={columnMarkerMouseDown('column-end')}
Expand All @@ -2505,7 +2507,7 @@ const RulerMarkers = React.memo((props: RulerMarkersProps) => {
rulerVisible={showExtraMarkers === 'row' ? 'visible' : 'not-visible'}
>
{/* Other markers for unselected tracks */}
{rulerMarkerData.otherRowMarkers.map((marker, index) => {
{frozenOrRegularMarkerData.otherRowMarkers.map((marker, index) => {
return (
<RulerMarkerIndicator
key={`ruler-marker-${index}`}
Expand All @@ -2522,7 +2524,7 @@ const RulerMarkers = React.memo((props: RulerMarkersProps) => {
<RulerMarkerIndicator
gridRect={rulerMarkerData.gridRect}
parentGrid={rulerMarkerData.parentGrid}
marker={frozenMarkers?.rowStart ?? rulerMarkerData.rowStart}
marker={frozenOrRegularMarkerData.rowStart}
axis={'row'}
visible={'visible'}
onMouseDown={rowMarkerMouseDown('row-start')}
Expand All @@ -2531,7 +2533,7 @@ const RulerMarkers = React.memo((props: RulerMarkersProps) => {
<RulerMarkerIndicator
gridRect={rulerMarkerData.gridRect}
parentGrid={rulerMarkerData.parentGrid}
marker={frozenMarkers?.rowEnd ?? rulerMarkerData.rowEnd}
marker={frozenOrRegularMarkerData.rowEnd}
axis={'row'}
visible={'visible'}
onMouseDown={rowMarkerMouseDown('row-end')}
Expand Down

0 comments on commit c54189e

Please sign in to comment.