Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/web_ui/dev/goldens_lock.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
repository: https://github.com/flutter/goldens.git
revision: 009fbdd595aeec364eaff6b8f337f8ceb3c44ab9
revision: 75729099b6f4d4e78ceb110b9305fc9905b91519
4 changes: 2 additions & 2 deletions lib/web_ui/lib/src/engine/path_to_svg.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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));
Expand Down