tests(): add failing test for direction rtl and textAlign START/END #1824
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, this is a PR that will add failing tests to show that ctx.direction isn't handled properly when textAlign is either start or end.
I plan to open a PR where with some simple logic between direction and text align start/end we can achieve a basic support.
The test uses also some arab text ( translated from google for the word left,right,start and end) to show that there is additional complexity when handling rtl
I added on purpose the property
ctx.direction = 'ltr'instead of the default inherit, since inherit requires the canvas to have an attribute to inspect that we don't have anyway.https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/direction
This is how the test looks like now.
