feat: rounded corners for display
This commit is contained in:
parent
a47aee1561
commit
e4ad9cc2f1
23 changed files with 337 additions and 282 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue