peterpeterparker / stylo

Another kind of rich text editor
https://stylojs.com
MIT License
714 stars 28 forks source link

allow more triangle styling and better placement #121

Closed malteludwig closed 1 year ago

malteludwig commented 1 year ago

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

Other information

Issue Number: N/A

peterpeterparker commented 1 year ago

Thanks for the PR 👍.

Had to make few adjustements after merge and I released it v0.0.44 afterwards.

malteludwig commented 1 year ago

@peterpeterparker There is a case where the triangle is off the toolbar, when you select text at the very left:

Screenshot 2023-03-25 at 21 12 47

I had added this: left: max(var(--stylo-toolbar-triangle-start), calc(var(--stylo-triangle-width) / 2)); to prevent the triangle going to far to the left if --stylo-toolbar-triangle-star is negative

Screenshot 2023-03-25 at 21 32 16
peterpeterparker commented 1 year ago

@malteludwig thanks for the ping. this did not work if the position was set in percent - i.e. when the menu set 50% the triangle was not correct positioned neither.

I fixed this edge case in this commit https://github.com/papyrs/stylo/commit/d9b66960863d6bad95129b9ca8c96f9ec0192ce3

Thanks for the ping