-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: fidelityMatching the OEM platforms betterMatching the OEM platforms betterc: renderingUI glitches reported at the engine/skia or impeller rendering levelUI glitches reported at the engine/skia or impeller rendering levele: web_htmlHTML rendering backend for WebHTML rendering backend for Webengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 1.22Found to occur in 1.22Found to occur in 1.22has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specificallywaiting for PR to land (fixed)A fix is in flightA fix is in flight
Description
Steps to reproduce
Run the following app in web:
import 'dart:ui';
import 'package:flutter/widgets.dart';
void main() {
runApp(BugReport());
}
class BugReport extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ColoredBox(
color: const Color(0xffffffff),
child: Padding(
padding: EdgeInsets.all(20),
child: CustomPaint(
painter: TitledBorderPainter(),
),
),
);
}
}
class TitledBorderPainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
final Rect titleRect = Rect.fromLTWH(20, 0, 50, 20);
final Paint paint = Paint()
..style = PaintingStyle.stroke
..color = const Color(0xff000000)
..strokeWidth = 1;
canvas.save();
try {
final Rect borderRect = Rect.fromLTRB(0, 10, size.width, size.height);
canvas.clipRect(titleRect, clipOp: ClipOp.difference);
canvas.drawRect(borderRect, paint);
} finally {
canvas.restore();
}
canvas..drawRect(titleRect, paint);
}
@override
bool shouldRepaint(TitledBorderPainter oldDelegate) => false;
}Expected behavior
You expect the rendered output to look something like this (as it does on mobile and desktop):
Actual behavior
The output looks like this:
Diagnosis
The actual output would be explained by the web engine treating ClipOp.difference as if it were ClipOp.intersect
Other info
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: fidelityMatching the OEM platforms betterMatching the OEM platforms betterc: renderingUI glitches reported at the engine/skia or impeller rendering levelUI glitches reported at the engine/skia or impeller rendering levele: web_htmlHTML rendering backend for WebHTML rendering backend for Webengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 1.22Found to occur in 1.22Found to occur in 1.22has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specificallywaiting for PR to land (fixed)A fix is in flightA fix is in flight

