瀏覽代碼

LayoutManager uses shortcut when delaying overflow fixes (#16963).

This change introduces an extracted method which will quick return if
a component needs a delayedOverflowFix.

Change-Id: I0d6ab100964a59e2f445a81271863a8212538d4d
tags/7.4.2
Fabian Lange 9 年之前
父節點
當前提交
cb73dcbf43
共有 1 個檔案被更改,包括 18 行新增9 行删除
  1. 18
    9
      client/src/com/vaadin/client/LayoutManager.java

+ 18
- 9
client/src/com/vaadin/client/LayoutManager.java 查看文件

@@ -605,15 +605,7 @@ public class LayoutManager {
ComponentConnector componentConnector = (ComponentConnector) connectorMap
.getConnector(connectorId);

// Delay the overflow fix if the involved connectors might still
// change
boolean connectorChangesExpected = !currentDependencyTree
.noMoreChangesExpected(componentConnector);
boolean parentChangesExcpected = componentConnector.getParent() instanceof ComponentConnector
&& !currentDependencyTree
.noMoreChangesExpected((ComponentConnector) componentConnector
.getParent());
if (connectorChangesExpected || parentChangesExcpected) {
if (delayOverflowFix(componentConnector)) {
delayedOverflowFixes.add(connectorId);
continue;
}
@@ -732,6 +724,23 @@ public class LayoutManager {
return measureCount;
}

/*
* Delay the overflow fix if the involved connectors might still change
*/
private boolean delayOverflowFix(ComponentConnector componentConnector) {
if (!currentDependencyTree.noMoreChangesExpected(componentConnector)) {
return true;
}
ServerConnector parent = componentConnector.getParent();
if (parent instanceof ComponentConnector
&& !currentDependencyTree
.noMoreChangesExpected((ComponentConnector) parent)) {
return true;
}

return false;
}

private void measureConnector(ComponentConnector connector) {
Profiler.enter("LayoutManager.measureConnector");
Element element = connector.getWidget().getElement();

Loading…
取消
儲存