适配4K分辨率
This commit is contained in:
parent
9f3855c75f
commit
fe6152d144
@ -700,7 +700,12 @@ public class ScreenShotPainter : MonoBehaviour
|
||||
RectFactory();
|
||||
break;
|
||||
case Status.Circle:
|
||||
var dis = Vector2.Distance(_lastPoint, Input.mousePosition) * 2;
|
||||
Vector2 last;
|
||||
Vector2 mouse;
|
||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(circleImg.rectTransform.parent as RectTransform, _lastPoint, null, out last);
|
||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(circleImg.rectTransform.parent as RectTransform, Input.mousePosition, null, out mouse);
|
||||
|
||||
var dis = Vector2.Distance(last, mouse) * 2;
|
||||
circleImg.rectTransform.sizeDelta = new Vector2(dis, dis);
|
||||
break;
|
||||
case Status.Arrow:
|
||||
@ -821,7 +826,7 @@ public class ScreenShotPainter : MonoBehaviour
|
||||
{
|
||||
if (lineStart != default)
|
||||
{
|
||||
var points = GenerateArrowPoints(lineStart, Input.mousePosition,0.1f);
|
||||
var points = GenerateArrowPoints(lineStart, Input.mousePosition, 0.1f);
|
||||
_lastPoint = lineStart;
|
||||
Paint(_eraserFlag, lineStart);
|
||||
LerpPaint(Input.mousePosition, _eraserFlag);
|
||||
@ -1038,10 +1043,6 @@ public class ScreenShotPainter : MonoBehaviour
|
||||
yield return new WaitForEndOfFrame();
|
||||
float width = _rightUpConnerPoint.x - _leftDownConnerPoint.x;
|
||||
float height = _rightUpConnerPoint.y - _leftDownConnerPoint.y;
|
||||
Debug.Log(_leftDownConnerPoint.x.ToString("0.00"));
|
||||
Debug.Log(_leftDownConnerPoint.y.ToString("0.00"));
|
||||
Debug.Log("width:" + width);
|
||||
Debug.Log("width:" + height);
|
||||
Rect rect = new Rect(_leftDownConnerPoint.x, _leftDownConnerPoint.y, width, height); //坑爹啊 如果是开携程在WaitForEndOfFrame时候截图,那么他的坐标系换了。。rect起始点要设置在左下角
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user