[web] Fix path to svg for drrect (flutter/engine#13779)

This commit is contained in:
Ferhat 2019-11-11 15:38:30 -08:00 committed by GitHub
parent d438263c6b
commit 19cec525aa
3 changed files with 17 additions and 4 deletions

View File

@ -1,2 +1,2 @@
repository: https://github.com/flutter/goldens.git
revision: 009fbdd595aeec364eaff6b8f337f8ceb3c44ab9
revision: 75729099b6f4d4e78ceb110b9305fc9905b91519

View File

@ -96,9 +96,9 @@ void pathToSvg(ui.Path path, StringBuffer sb,
final double blRadiusY = rrect.blRadiusY.abs();
final double brRadiusY = rrect.brRadiusY.abs();
sb.write('L ${left + trRadiusX} $top ');
sb.write('M ${left + trRadiusX} $top ');
// Top side and top-right corner
sb.write('M ${right - trRadiusX} $top ');
sb.write('L ${right - trRadiusX} $top ');
_writeEllipse(sb, right - trRadiusX, top + trRadiusY, trRadiusX,
trRadiusY, 0, 1.5 * math.pi, 2.0 * math.pi, false);
// Right side and bottom-right corner

View File

@ -31,7 +31,7 @@ void main() async {
try {
sceneElement.append(engineCanvas.rootElement);
html.document.body.append(sceneElement);
await matchGoldenFile('$fileName.png', region: region, maxDiffRate: 0.02);
await matchGoldenFile('$fileName.png', region: region, maxDiffRate: 0.2);
} finally {
// The page is reused across tests, so remove the element after taking the
// Scuba screenshot.
@ -100,6 +100,19 @@ void main() async {
await _checkScreenshot(rc, 'draw_image_rect_with_source');
});
test('Paints image with source and destination and round clip', () async {
final RecordingCanvas rc =
RecordingCanvas(const Rect.fromLTRB(0, 0, 400, 300));
Image testImage = createTestImage();
double testWidth = testImage.width.toDouble();
double testHeight = testImage.height.toDouble();
rc.save();
rc.clipRRect(RRect.fromLTRBR(100, 30, 2 * testWidth, 2 * testHeight, Radius.circular(16)));
rc.drawImageRect(testImage, Rect.fromLTRB(testWidth / 2, 0, testWidth, testHeight),
Rect.fromLTRB(100, 30, 2 * testWidth, 2 * testHeight), new Paint());
await _checkScreenshot(rc, 'draw_image_rect_with_source_and_clip');
});
test('Paints image with transform using source and destination', () async {
final RecordingCanvas rc =
RecordingCanvas(const Rect.fromLTRB(0, 0, 400, 300));