diff --git a/Assets/XCharts/CHANGELOG-EN.md b/Assets/XCharts/CHANGELOG-EN.md index 13fddf8f..8805f7be 100644 --- a/Assets/XCharts/CHANGELOG-EN.md +++ b/Assets/XCharts/CHANGELOG-EN.md @@ -35,6 +35,7 @@ ## master +* (2021.06.13) Improved support for multiple screens * (2021.06.12) Add `iconStyle` `align` parameter to set the horizontal alignment of the icon * (2021.06.12) Optimized import of `Theme` and automatic font refresh (#148) * (2021.06.10) Fixed compatibility issues with `Unity` version (#154) diff --git a/Assets/XCharts/CHANGELOG.md b/Assets/XCharts/CHANGELOG.md index 0b89580d..80e57d4b 100644 --- a/Assets/XCharts/CHANGELOG.md +++ b/Assets/XCharts/CHANGELOG.md @@ -35,6 +35,7 @@ ## master +* (2021.06.13) 完善对多屏幕的支持 * (2021.06.12) 增加`IconStyle`的`align`参数设置图标的水平对齐 * (2021.06.12) 优化主题`Theme`的导入和字体自动刷新 (#148) * (2021.06.10) 修复`Unity`版本兼容问题 (#154) diff --git a/Assets/XCharts/Runtime/API/BaseGraph_API.cs b/Assets/XCharts/Runtime/API/BaseGraph_API.cs index 13829ed0..691d56af 100644 --- a/Assets/XCharts/Runtime/API/BaseGraph_API.cs +++ b/Assets/XCharts/Runtime/API/BaseGraph_API.cs @@ -166,6 +166,9 @@ public void RemoveChartObject() public bool ScreenPointToChartPoint(Vector2 screenPoint, out Vector2 chartPoint) { +#if ! UNITY_EDITOR + screenPoint = Display.RelativeMouseAt(screenPoint); +#endif var cam = canvas.renderMode == RenderMode.ScreenSpaceOverlay ? null : canvas.worldCamera; if (!RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, screenPoint, cam, out chartPoint))