浏览代码

revert unnecessary changes

/zxw-fix_transform_hover_issue
Xingwei Zhu 3 年前
当前提交
9cdbd4f1
共有 2 个文件被更改,包括 25 次插入55 次删除
  1. 27
      com.unity.uiwidgets/Runtime/rendering/proxy_box.cs
  2. 53
      com.unity.uiwidgets/Runtime/widgets/basic.cs

27
com.unity.uiwidgets/Runtime/rendering/proxy_box.cs


public override bool needsCompositing {
get { return base.needsCompositing || _annotationIsActive; }
}
ImageFilter _filter;
if (child != null) {
if (_annotationIsActive) {
Debug.Log("paint 1 >>>>>");
layer = layer ?? new AnnotatedRegionLayer<MouseTrackerAnnotation>(
_hoverAnnotation,
size: size,
offset: offset,
opaque: opaque // TODO
if (_annotationIsActive) {
var layer = new AnnotatedRegionLayer<MouseTrackerAnnotation>(
_hoverAnnotation,
size: size,
offset: offset,
opaque: opaque
context.pushLayer(layer, base.paint, offset);
}
else {
Debug.Log("paint 2 >>>>>");
base.paint(context, offset);
}
context.pushLayer(layer, base.paint, offset);
layer = null;
base.paint(context, offset);
}
}

53
com.unity.uiwidgets/Runtime/widgets/basic.cs


properties.add(new FloatProperty("aspectRatio", aspectRatio));
}
}
/*
public class MouseRegion : StatefulWidget {
public MouseRegion(
Key key = null,

public override Widget build(BuildContext context) {
return new _RawMouseRegion(this);
}
}*/
}
public class MouseRegion : SingleChildRenderObjectWidget {
public MouseRegion(
Key key = null,
PointerEnterEventListener onEnter = null,
PointerExitEventListener onExit = null,
PointerHoverEventListener onHover = null,
bool opaque = true,
Widget child = null
) : base(key: key, child: child) {
this.onEnter = onEnter;
this.onExit = onExit;
this.onHover = onHover;
this.opaque = opaque;
public class _RawMouseRegion : SingleChildRenderObjectWidget {
public _RawMouseRegion(_MouseRegionState owner) : base(child: owner.widget.child) {
this.owner = owner;
public readonly PointerEnterEventListener onEnter;
public readonly PointerHoverEventListener onHover;
public readonly PointerExitEventListener onExit;
public readonly bool opaque;
void handleExit(PointerExitEvent _event) {
if (onExit != null) {
onExit(_event);
}
}
public PointerExitEventListener getHandleExit() {
return onExit == null ? (PointerExitEventListener) null : handleExit;
}
public readonly _MouseRegionState owner;
MouseRegion widget = owner.widget;
onEnter: onEnter,
onHover: onHover,
onExit: getHandleExit(),
opaque: opaque
onEnter: widget.onEnter,
onHover: widget.onHover,
onExit: owner.getHandleExit(),
opaque: widget.opaque
_renderObject.onEnter = onEnter;
_renderObject.onHover = onHover;
_renderObject.onExit = getHandleExit();
_renderObject.opaque = opaque;
MouseRegion widget = owner.widget;
_renderObject.onEnter = widget.onEnter;
_renderObject.onHover = widget.onHover;
_renderObject.onExit = owner.getHandleExit();
_renderObject.opaque = widget.opaque;
}
}

正在加载...
取消
保存