daybrush / ruler

A Ruler component that can draw grids and scroll infinitely.
https://daybrush.com/ruler/
MIT License
334 stars 39 forks source link

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

Open xiaopujun opened 1 year ago

xiaopujun commented 1 year ago

Environments

Description

image image

xiaopujun commented 1 year ago

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 commented 1 year ago

@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} />