feat: rounded corners for display

This commit is contained in:
Gerard Gascón 2024-04-18 11:16:43 +02:00
parent a47aee1561
commit e4ad9cc2f1
23 changed files with 337 additions and 282 deletions

View file

@ -7,7 +7,6 @@ namespace SatorImaging.AppWindowUtility {
private bool _isDragging;
private Vector2 _targetPosition = Vector2.zero;
private Vector2 _resizeDirection = Vector2.zero;
private void Update() {
#if UNITY_EDITOR
@ -20,12 +19,10 @@ namespace SatorImaging.AppWindowUtility {
if (Input.GetMouseButtonDown((int)mouseButton)) {
_targetPosition = Event.current.mousePosition;
_resizeDirection =
ResizeHelper.GetDirection(_targetPosition, new Vector2(Screen.width, Screen.height));
_isDragging = true;
}
if (_isDragging && Input.GetMouseButton((int)mouseButton) && _resizeDirection == Vector2.zero) {
if (_isDragging && Input.GetMouseButton((int)mouseButton)) {
// do NOT use Event.current.delta. it's sampled in local window coordinate.
// and moving window while mouse dragging changes coordinate sample by sample.
// just remove the gap between current mouse position and drag starting position.