diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 5d4450db..efd4a126 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -79,6 +79,7 @@ slug: /changelog ## master +* (2025.02.09) 修复`SaveAsImage`保存图片时不支持透明度的问题 (#337) * (2025.02.05) 增加`GraphChart`可单独设置`data`样式的支持 * (2025.02.05) 重构`SerieSymbol`的`sizeFunction`参数 * (2025.01.23) 修复`Treemap`的`Label`不显示的问题 diff --git a/Examples/Example50_Scatter.cs b/Examples/Example50_Scatter.cs index 80f8f967..63d377fd 100644 --- a/Examples/Example50_Scatter.cs +++ b/Examples/Example50_Scatter.cs @@ -21,9 +21,9 @@ namespace XCharts.Example } } - float SymbolSize(List data) + float SymbolSize(float defaultSize, SerieData serieData) { - return (float) (Math.Sqrt(data[2]) / 6e2); + return defaultSize; } } } \ No newline at end of file diff --git a/Runtime/Internal/Utilities/ChartHelper.cs b/Runtime/Internal/Utilities/ChartHelper.cs index 6c1b31bf..46b9238a 100644 --- a/Runtime/Internal/Utilities/ChartHelper.cs +++ b/Runtime/Internal/Utilities/ChartHelper.cs @@ -1059,12 +1059,12 @@ namespace XCharts.Runtime { var cam = canvas.renderMode == RenderMode.ScreenSpaceOverlay ? null : canvas.worldCamera; var pos = RectTransformUtility.WorldToScreenPoint(cam, rectTransform.position); - var width = rectTransform.rect.width * canvas.scaleFactor; - var height = rectTransform.rect.height * canvas.scaleFactor; + var width = (int)(rectTransform.rect.width * canvas.scaleFactor); + var height = (int)(rectTransform.rect.height * canvas.scaleFactor); var posX = pos.x + rectTransform.rect.xMin * canvas.scaleFactor; var posY = pos.y + rectTransform.rect.yMin * canvas.scaleFactor; var rect = new Rect(posX, posY, width, height); - var tex = new Texture2D((int)width, (int)height, TextureFormat.RGBA32, false); + var tex = new Texture2D(width, height, TextureFormat.ARGB32, false); tex.ReadPixels(rect, 0, 0); tex.Apply(); byte[] bytes;