void Awake() { Instance = this; DrawingSize = App.CurrentDrawingFile.Size; Cursor.OnCursorMovedEvent += OnCursorMoved; Cursor.OnCursorDraggedEvent += OnCursorDragged; Cursor.OnCursorClickedEvent += OnCursorClicked; ToolBar.OnToolChangedEvent += OnToolChanged; ColorTab.OnColorChangedEvent += color => MainColor = color; }
public void OnResolutionFieldEndEdit() { int x, y; var stringX = ResolutionXField.text.Replace("px", ""); var stringY = ResolutionYField.text.Replace("px", ""); if ( int.TryParse(stringX, out x) && int.TryParse(stringY, out y) && 0 < x && 0 < y) { ResolutionXField.text = x + "px"; ResolutionYField.text = y + "px"; DrawingScheduler.ResizeDrawing(new Short2(x, y)); } else { ResetResolutionField(); } }