Skip to content

Commit

Permalink
more web fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
goderbauer committed Jan 25, 2023
1 parent 5ddd80b commit a9c358c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
5 changes: 1 addition & 4 deletions lib/web_ui/lib/src/engine/canvas_pool.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1011,13 +1011,10 @@ class ContextStateHandle {
context.translate(shaderBounds!.left, shaderBounds.top);
}
}
} else if (paint.color != null) {
} else {
final String? colorString = colorValueToCssString(paint.color);
fillStyle = colorString;
strokeStyle = colorString;
} else {
fillStyle = '#000000';
strokeStyle = '#000000';
}

final ui.MaskFilter? maskFilter = paint.maskFilter;
Expand Down
7 changes: 2 additions & 5 deletions lib/web_ui/lib/src/engine/html/dom_canvas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ DomHTMLElement buildDrawRectElement(
..transformOrigin = '0 0 0'
..transform = effectiveTransform;

String cssColor =
paint.color == null ? '#000000' : colorValueToCssString(paint.color)!;
String cssColor = colorValueToCssString(paint.color)!;

if (paint.maskFilter != null) {
final double sigma = paint.maskFilter!.webOnlySigma;
Expand Down Expand Up @@ -352,10 +351,8 @@ SVGSVGElement pathToSvgElement(SurfacePath path, SurfacePaintData paint) {
svgPath.setAttribute('stroke-linecap', '${stringForStrokeCap(paint.strokeCap)}');
}
svgPath.setAttribute('fill', 'none');
} else if (paint.color != null) {
svgPath.setAttribute('fill', colorValueToCssString(paint.color)!);
} else {
svgPath.setAttribute('fill', '#000000');
svgPath.setAttribute('fill', colorValueToCssString(paint.color)!);
}
if (path.fillType == ui.PathFillType.evenOdd) {
svgPath.setAttribute('fill-rule', 'evenodd');
Expand Down
4 changes: 1 addition & 3 deletions lib/web_ui/lib/src/engine/html/painting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,7 @@ class SurfacePaintData {
if (strokeJoin != null) {
buffer.write('strokeJoin = $strokeJoin; ');
}
if (color != null) {
buffer.write('color = ${colorToCssString(ui.Color(color))}; ');
}
buffer.write('color = ${colorToCssString(ui.Color(color))}; ');
if (shader != null) {
buffer.write('shader = $shader; ');
}
Expand Down
8 changes: 1 addition & 7 deletions lib/web_ui/lib/src/engine/semantics/semantics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,6 @@ class SemanticsObject {
void updateSelf(SemanticsNodeUpdate update) {
// Update all field values and their corresponding dirty flags before
// applying the updates to the DOM.
assert(update.flags != null);
if (_flags != update.flags) {
_flags = update.flags;
_markFlagsDirty();
Expand Down Expand Up @@ -1613,12 +1612,7 @@ class EngineSemanticsOwner {
/// the Web Engine.
///
/// The default mode is [AccessibilityMode.unknown].
AccessibilityMode get mode => _mode;
set mode(AccessibilityMode value) {
_mode = value;
}

AccessibilityMode _mode = AccessibilityMode.unknown;
AccessibilityMode mode = AccessibilityMode.unknown;

/// Currently used [GestureMode].
///
Expand Down

0 comments on commit a9c358c

Please sign in to comment.