daybrush / ruler

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

Option to render selectedRange values #38

Closed bytasv closed 1 year ago

bytasv commented 1 year ago

Environments

All / latest

Description

Hey there 👋 I was wondering - how difficult would it be to add values for selectedRanges like so (see blue titles on the edge):

CleanShot 2023-01-29 at 14 54 13@2x

Maybe something like this:

https://github.com/daybrush/ruler/blob/master/packages/react-ruler/src/react-ruler/Ruler.tsx#L206 (I'm not familiar with drawing in canvas, but maybe it would be easy then to draw text on each side of selected range?)

daybrush commented 1 year ago

@bytasv

ruler, guides's new version is released. selectedRangesText, selectedRangesTextOffset, selectedRangesTextColor props are added. Try it.

bytasv commented 1 year ago

Thanks alot! 🙇