Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elements are misaligned with the scale after scaling of the canvas #41

Open
xiaopujun opened this issue May 4, 2023 · 2 comments
Open
Labels
question Further information is requested

Comments

@xiaopujun
Copy link

Environments

  • Framework name:node16.10、react17
  • Framework version:
  • Component name: React Ruler
  • Component version:
  • Testable Address(optional):

Description

image
image

@xiaopujun
Copy link
Author

The second image is scaled to 200% and the relative position of the elements to the scale is always the same. Is this effect Ruler component achievable?

@daybrush daybrush added the question Further information is requested label May 4, 2023
@daybrush
Copy link
Owner

daybrush commented May 4, 2023

@xiaopujun

ruler has zoom prop (default 1)

Try using the zoom property. (https://github.com/daybrush/ruler#ruler-units)

const [zoom, setZoom] = useState(1);

<Ruler zoom={zoom} />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants