mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
This reverts commit 57b4a52555
.
This commit is contained in:
parent
57b4a52555
commit
61a8132ea9
@ -1 +1 @@
|
|||||||
d8740c70a58ada74aff5b773e2bec9d622c42a97
|
6a724f0d3e22d41246baf3447d7ba2c9ff886765
|
||||||
|
@ -755,20 +755,20 @@ class PhysicalModelLayer extends ContainerLayer {
|
|||||||
/// Creates a composited layer that uses a physical model to producing
|
/// Creates a composited layer that uses a physical model to producing
|
||||||
/// lighting effects.
|
/// lighting effects.
|
||||||
///
|
///
|
||||||
/// The [clipPath], [elevation], and [color] arguments must not be null.
|
/// The [clipRRect], [elevation], and [color] arguments must not be null.
|
||||||
PhysicalModelLayer({
|
PhysicalModelLayer({
|
||||||
@required this.clipPath,
|
@required this.clipRRect,
|
||||||
@required this.elevation,
|
@required this.elevation,
|
||||||
@required this.color,
|
@required this.color,
|
||||||
}) : assert(clipPath != null),
|
}) : assert(clipRRect != null),
|
||||||
assert(elevation != null),
|
assert(elevation != null),
|
||||||
assert(color != null);
|
assert(color != null);
|
||||||
|
|
||||||
/// The path to clip in the parent's coordinate system.
|
/// The rounded-rect to clip in the parent's coordinate system.
|
||||||
///
|
///
|
||||||
/// The scene must be explicitly recomposited after this property is changed
|
/// The scene must be explicitly recomposited after this property is changed
|
||||||
/// (as described at [Layer]).
|
/// (as described at [Layer]).
|
||||||
Path clipPath;
|
RRect clipRRect;
|
||||||
|
|
||||||
/// The z-coordinate at which to place this physical object.
|
/// The z-coordinate at which to place this physical object.
|
||||||
///
|
///
|
||||||
@ -784,8 +784,8 @@ class PhysicalModelLayer extends ContainerLayer {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void addToScene(ui.SceneBuilder builder, Offset layerOffset) {
|
void addToScene(ui.SceneBuilder builder, Offset layerOffset) {
|
||||||
builder.pushPhysicalShape(
|
builder.pushPhysicalModel(
|
||||||
path: clipPath.shift(layerOffset),
|
rrect: clipRRect.shift(layerOffset),
|
||||||
elevation: elevation,
|
elevation: elevation,
|
||||||
color: color,
|
color: color,
|
||||||
);
|
);
|
||||||
@ -796,6 +796,7 @@ class PhysicalModelLayer extends ContainerLayer {
|
|||||||
@override
|
@override
|
||||||
void debugFillProperties(DiagnosticPropertiesBuilder description) {
|
void debugFillProperties(DiagnosticPropertiesBuilder description) {
|
||||||
super.debugFillProperties(description);
|
super.debugFillProperties(description);
|
||||||
|
description.add(new DiagnosticsProperty<RRect>('clipRRect', clipRRect));
|
||||||
description.add(new DoubleProperty('elevation', elevation));
|
description.add(new DoubleProperty('elevation', elevation));
|
||||||
description.add(new DiagnosticsProperty<Color>('color', color));
|
description.add(new DiagnosticsProperty<Color>('color', color));
|
||||||
}
|
}
|
||||||
|
@ -1426,10 +1426,9 @@ class RenderPhysicalModel extends _RenderCustomClip<RRect> {
|
|||||||
_updateClip();
|
_updateClip();
|
||||||
final RRect offsetClipRRect = _clip.shift(offset);
|
final RRect offsetClipRRect = _clip.shift(offset);
|
||||||
final Rect offsetBounds = offsetClipRRect.outerRect;
|
final Rect offsetBounds = offsetClipRRect.outerRect;
|
||||||
final Path offsetClipPath = new Path()..addRRect(offsetClipRRect);
|
|
||||||
if (needsCompositing) {
|
if (needsCompositing) {
|
||||||
final PhysicalModelLayer physicalModel = new PhysicalModelLayer(
|
final PhysicalModelLayer physicalModel = new PhysicalModelLayer(
|
||||||
clipPath: offsetClipPath,
|
clipRRect: offsetClipRRect,
|
||||||
elevation: elevation,
|
elevation: elevation,
|
||||||
color: color,
|
color: color,
|
||||||
);
|
);
|
||||||
@ -1446,7 +1445,7 @@ class RenderPhysicalModel extends _RenderCustomClip<RRect> {
|
|||||||
_transparentPaint,
|
_transparentPaint,
|
||||||
);
|
);
|
||||||
canvas.drawShadow(
|
canvas.drawShadow(
|
||||||
offsetClipPath,
|
new Path()..addRRect(offsetClipRRect),
|
||||||
shadowColor,
|
shadowColor,
|
||||||
elevation,
|
elevation,
|
||||||
color.alpha != 0xFF,
|
color.alpha != 0xFF,
|
||||||
|
Loading…
Reference in New Issue
Block a user