Skip to content

Commit

Permalink
feat: add defaultGuidesPos prop
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Apr 9, 2023
1 parent 0f19b3c commit a7d31ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/react-guides/src/react-guides/Guides.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default class Guides extends React.PureComponent<GuidesProps, GuidesState
guideStyle: {},
dragGuideStyle: {},
guidePosStyle: {},
defaultGuidesPos: 0,
};
public state: GuidesState = {
guides: [],
Expand All @@ -55,6 +56,7 @@ export default class Guides extends React.PureComponent<GuidesProps, GuidesState
constructor(props: GuidesProps) {
super(props);
this.state.guides = props.defaultGuides || [];
this.scrollPos = props.defaultGuidesPos || 0;
}
public render() {
const {
Expand Down
5 changes: 5 additions & 0 deletions packages/react-guides/src/react-guides/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ export interface GuidesOptions extends RulerProps {
* @default []
*/
defaultGuides?: number[];
/**
* default guide pos for init
* @default 0
*/
defaultGuidesPos?: number
/**
* Whether to show guidelines
* @default true
Expand Down

0 comments on commit a7d31ea

Please sign in to comment.