Skip to content

Commit

Permalink
feat: add ruler unit, segment option
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Jun 2, 2023
1 parent dc28298 commit a18a52a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/react-ruler/src/react-ruler/Ruler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,21 @@ export default class Ruler extends React.PureComponent<RulerProps> implements Ru
zoom: nextZoom = this._zoom,
scrollPos = this.state.scrollPos,
marks = props.marks,
selectedRanges = props.selectedRanges,
selectedRanges = props.selectedRanges!,
segment = props.segment || 10,
unit = props.unit!,
} = options;

this._zoom = nextZoom;

const {
unit,
type,
backgroundColor,
lineColor,
textColor,
textBackgroundColor,
direction,
negativeRuler = true,
segment = 10,
textFormat,
range = [-Infinity, Infinity],
rangeBackgroundColor,
Expand Down
2 changes: 2 additions & 0 deletions packages/react-ruler/src/react-ruler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export interface DrawRulerOptions {
zoom?: number;
selectedRanges?: number[][];
marks?: number[];
unit?: number;
segment?: number;
}

/**
Expand Down

0 comments on commit a18a52a

Please sign in to comment.