This commit is contained in:
李浩 2025-05-09 14:45:12 +08:00
commit 9bdc4fab8e

View File

@ -1,12 +1,8 @@
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using QFramework;
using System.IO; using System.IO;
using UnityEngine.Rendering.Universal;
using TMPro; using TMPro;
using UnityEngine.EventSystems;
using DG.Tweening; using DG.Tweening;
using System;
namespace QFramework.Example namespace QFramework.Example
{ {
@ -169,8 +165,8 @@ namespace QFramework.Example
float sizeY = ((float)Screen.height / (float)Screen.width) * size; float sizeY = ((float)Screen.height / (float)Screen.width) * size;
ScreenShotPainter.instance.SetEraserSize(size, sizeY); ScreenShotPainter.instance.SetEraserSize(size, sizeY);
float width = Screen.width / size; float width = 1920 / size;
float height = Screen.width / size;//不缩放y轴了 float height = 1920 / size;//不缩放y轴了
Icon.transform.localScale = new Vector3(width / Icon.rectTransform.rect.width, height / Icon.rectTransform.rect.height, 1); Icon.transform.localScale = new Vector3(width / Icon.rectTransform.rect.width, height / Icon.rectTransform.rect.height, 1);
} }
else else
@ -180,8 +176,8 @@ namespace QFramework.Example
float sizeY = ((float)Screen.height / (float)Screen.width) * size; float sizeY = ((float)Screen.height / (float)Screen.width) * size;
ScreenShotPainter.instance.SetPaintingSize(size, sizeY); ScreenShotPainter.instance.SetPaintingSize(size, sizeY);
float width = Screen.width / size; float width = 1920 / size;
float height = Screen.width / size;//不缩放y轴了 float height = 1920 / size;//不缩放y轴了
Icon.transform.localScale = new Vector3(width / Icon.rectTransform.rect.width, height / Icon.rectTransform.rect.height, 1); Icon.transform.localScale = new Vector3(width / Icon.rectTransform.rect.width, height / Icon.rectTransform.rect.height, 1);
} }