浏览代码

add scroll in editor panel

/siyaoH-1.17-PlatformMessage
Shiyun Wen 4 年前
当前提交
e020d4a1
共有 2 个文件被更改,包括 10 次插入5 次删除
  1. 7
      com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs
  2. 8
      com.unity.uiwidgets/Runtime/rendering/list_wheel_viewport.cs

7
com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs


var pos = _getPointerPosition(evt.mousePosition);
_wrapper.OnMouseMove(pos);
}
else if (evt.type == EventType.ScrollWheel && evt.delta.magnitude != 0) {
var delta = evt.delta;
delta.x = 0f;
delta.y /= 3f;
var pos = _getPointerPosition(evt.mousePosition);
_wrapper.OnMouseScroll(delta, pos);
}
}

8
com.unity.uiwidgets/Runtime/rendering/list_wheel_viewport.cs


var deltaY = radius * Mathf.Sin(angle);
Matrix4 transform = MatrixUtils.createCylindricalProjectionTransform(
radius: size.height * _diameterRatio / 2.0f,
radius: size.height * _diameterRatio / 2.0F,
angle: angle,
perspective: _perspective
);

untransformedPaintingCoordinates.dx,
-_topScrollMarginExtent
);
bool shouldApplyOffCenterDim = overAndUnderCenterOpacity < 1;
if (useMagnifier || shouldApplyOffCenterDim) {
_paintChildWithMagnifier(context, offset, child, transform, offsetToCenter, untransformedPaintingCoordinates);

context1.pushTransform(
needsCompositing,
offset1,
cylindricalTransform,
// this._centerOriginTransform(cylindricalTransform),
_magnifyTransform(),
(PaintingContext context2, Offset offset2) => {
context2.paintChild(child, offset2 + untransformedPaintingCoordinates);
});

正在加载...
取消
保存