Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit be255cf

Browse files
author
Yuncong Zhang
committed
Merge branch 'master' into yczhang
2 parents 3a014f6 + c2e54c7 commit be255cf

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

Runtime/engine/UIWidgetsPanel.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,15 @@ protected override void OnDisable() {
187187
protected virtual Widget createWidget() {
188188
return null;
189189
}
190+
191+
public void recreateWidget() {
192+
Widget root;
193+
using (this._windowAdapter.getScope()) {
194+
root = this.createWidget();
195+
}
196+
197+
this._windowAdapter.attachRootWidget(root);
198+
}
190199

191200
internal void applyRenderTexture(Rect screenRect, Texture texture, Material mat) {
192201
this.texture = texture;

Runtime/gestures/converter.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ public static IEnumerable<PointerEvent> expand(IEnumerable<PointerData> data, fl
7575
switch (datum.change) {
7676
case PointerChange.down: {
7777
_PointerState state = _ensureStateForPointer(datum, position);
78-
D.assert(!state.down);
78+
if (state.down) {
79+
break;
80+
}
7981
if (state.lastPosition != position) {
8082
// a hover event to be here.
8183
state.lastPosition = position;

Runtime/ui/painting/canvas_impl.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -753,11 +753,6 @@ public void flush(Picture picture) {
753753
D.assert(this._layers[0].states.Count == 1);
754754

755755
var layer = this._currentLayer;
756-
if (layer.draws.Count == 0) {
757-
D.assert(layer.layers.Count == 0);
758-
return;
759-
}
760-
761756
using (var cmdBuf = new CommandBuffer()) {
762757
cmdBuf.name = "CommandBufferCanvas";
763758

@@ -870,6 +865,12 @@ void _drawLayer(RenderLayer layer, CommandBuffer cmdBuf) {
870865
break;
871866
}
872867
}
868+
869+
if (toClear) {
870+
this._setRenderTarget(cmdBuf, layer.rtID, ref toClear);
871+
}
872+
873+
D.assert(!toClear);
873874

874875
foreach (var subLayer in layer.layers) {
875876
cmdBuf.ReleaseTemporaryRT(subLayer.rtID);

Runtime/ui/painting/shadow_utils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Unity.UIWidgets.ui {
44
static class ShadowUtils {
5-
public static bool kUseFastShadow = true;
5+
public static bool kUseFastShadow = false;
66

77
public const float kAmbientHeightFactor = 1.0f / 128.0f;
88
public const float kAmbientGeomFactor = 64.0f;

0 commit comments

Comments
 (0)