示例#1
0
        void load(DrawableEditor editor)
        {
            _editor = editor;

            _fontFamily = editor.FontFamily.GetBoundCopy();
            _fontFamily.BindValueChanged(f => Font = f, runOnceImmediately: true);

            _fontSize = editor.FontSize.GetBoundCopy();
            _fontSize.BindValueChanged(s => TextSize = s, runOnceImmediately: true);

            Style.BindValueChanged(updateStyle);
            ResetStyle();
        }
        void load(DrawableEditor editor)
        {
            _editor = editor;

            _fontSize = editor.FontSize.GetBoundCopy() as BindableFloat;
            _fontSize.BindValueChanged(s => Scheduler.AddOnce(ResetFlicker));

            _lineNumberWidth = editor.LineNumberWidth.GetBoundCopy() as BindableInt;
            _lineNumberWidth.BindValueChanged(w => Scheduler.AddOnce(ResetFlicker));

            _selectionStart = _selection.Start.GetBoundCopy() as BindableInt;
            _selectionStart.BindValueChanged(i => Scheduler.AddOnce(ResetFlicker));

            _selectionEnd = _selection.End.GetBoundCopy() as BindableInt;
            _selectionEnd.BindValueChanged(i => Scheduler.AddOnce(ResetFlicker));

            _selectionEnd.TriggerChange();
        }
示例#3
0
        void load(DrawableEditor editor)
        {
            _editor = editor;

            _fontSize = editor.FontSize.GetBoundCopy() as BindableFloat;
            _fontSize.BindValueChanged(s => Scheduler.AddOnce(() =>
            {
                Size = new Vector2(3, s);
                ResetFlicker();
            }));

            _lineNumberWidth = editor.LineNumberWidth.GetBoundCopy() as BindableInt;
            _lineNumberWidth.BindValueChanged(w => Scheduler.AddOnce(ResetFlicker));

            _selectionEnd = _selection.End.GetBoundCopy() as BindableInt;
            _selectionEnd.BindValueChanged(i => Scheduler.AddOnce(ResetFlicker));

            // This updates the caret
            _fontSize.TriggerChange();
        }
示例#4
0
 public SelectionRange(DrawableEditor editor)
 {
     _editor = editor;
 }