fix(TextMetrics): rtl direction + start/end textAlign#2510
fix(TextMetrics): rtl direction + start/end textAlign#2510chearon merged 6 commits intoAutomattic:masterfrom
Conversation
ShaMan123
left a comment
There was a problem hiding this comment.
Is there any other test/thing I should add/do?
chearon
left a comment
There was a problem hiding this comment.
Thanks and I'm glad to see new tests! Need a couple of changes I think.
| it("2d.type class string", function () { | ||
| const canvas = createCanvas(100, 50); | ||
| const ctx = canvas.getContext("2d"); | ||
| assert.strictEqual(Object.prototype.toString.call(ctx), '[object CanvasRenderingContext2D]') |
There was a problem hiding this comment.
Did this need to be removed?
There was a problem hiding this comment.
I ran npm run generate-wpt - this is outdated code I believe
|
|
||
| ctx.textAlign = "left" | ||
| metrics = ctx.measureText('hello'); | ||
| @assert metrics.actualBoundingBoxLeft < metrics.actualBoundingBoxRight; |
There was a problem hiding this comment.
I don't think this goes here. This test is imported from the WPT tests, so it would get overwritten if they did any updates. You should be able to write this in canvas.test.js though.
There was a problem hiding this comment.
I thought the yaml files generate the js test files. Regardless I saw nothing runs these tests on CI
This reverts commit 7f782ae.
ShaMan123
left a comment
There was a problem hiding this comment.
I reverted the pwt changes in favor of the jest test and exposed resolveTextAlignment as requested
| } | ||
| } | ||
|
|
||
| text_align_t |
There was a problem hiding this comment.
Should I expose a strict text align enum?
enum text_align_strict_t : int8_t {
STRICT_TEXT_ALIGNMENT_LEFT = TEXT_ALIGNMENT_LEFT,
STRICT_TEXT_ALIGNMENT_CENTER = TEXT_ALIGNMENT_CENTER,
STRICT_TEXT_ALIGNMENT_RIGHT = TEXT_ALIGNMENT_RIGHT
};
|
@chearon ? |
Thanks for contributing!
closes #2508