Skip to content

Commit

Permalink
fix: bg_image_update not update error
Browse files Browse the repository at this point in the history
  • Loading branch information
burtonsun authored and andycall committed Dec 27, 2023
1 parent d563d13 commit 47952d3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion webf/lib/src/rendering/box_decoration_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,15 @@ class BoxDecorationPainter extends BoxPainter {

void _paintBackgroundImage(Canvas canvas, Rect rect, ImageConfiguration configuration) {
if (_decoration.image == null) return;
if(_imagePainter == null) {
_imagePainter = BoxDecorationImagePainter._(
_decoration.image!,
renderStyle,
onChanged!
);
} else {
_imagePainter!.image = _decoration.image!;
}
_imagePainter ??= BoxDecorationImagePainter._(_decoration.image!, renderStyle, onChanged!);
Path? clipPath;
switch (_decoration.shape) {
Expand Down Expand Up @@ -400,7 +409,11 @@ class BoxDecorationImagePainter {
BoxDecorationImagePainter._(this._details, this._renderStyle, this._onChanged);

final CSSRenderStyle _renderStyle;
final DecorationImage _details;
DecorationImage _details;

set image(DecorationImage detail){
_details = detail;
}
CSSBackgroundPosition get _backgroundPositionX {
return _renderStyle.backgroundPositionX;
}
Expand Down

0 comments on commit 47952d3

Please sign in to comment.