mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[web] Remove left/top/transform reset since all code paths now set ltwh (flutter/engine#17867)
* [web] Remove left/top/transform reset since all code paths now set ltwh * Remove unused style var * Handle path=null , address review comments * Added comment for reset code
This commit is contained in:
parent
a28b4235ee
commit
6c022dea38
@ -325,16 +325,18 @@ class PersistedPhysicalShape extends PersistedContainerSurface
|
||||
}
|
||||
if (oldSurface.path != path) {
|
||||
oldSurface._clipElement?.remove();
|
||||
// Reset style on prior element since we may have switched between
|
||||
// rect/rrect and arbitrary path.
|
||||
final html.CssStyleDeclaration style = rootElement.style;
|
||||
style.transform = '';
|
||||
style.left = '';
|
||||
style.top = '';
|
||||
style.borderRadius = '';
|
||||
domRenderer.setElementStyle(rootElement, 'clip-path', '');
|
||||
domRenderer.setElementStyle(rootElement, '-webkit-clip-path', '');
|
||||
_applyShape();
|
||||
// This null check is in update since we don't want to unnecessarily
|
||||
// clear style in apply on first build.
|
||||
if (path == null) {
|
||||
// Reset style on prior element when path becomes null.
|
||||
final html.CssStyleDeclaration style = rootElement.style;
|
||||
style.left = '';
|
||||
style.top = '';
|
||||
style.borderRadius = '';
|
||||
}
|
||||
} else {
|
||||
_clipElement = oldSurface._clipElement;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user