protected override void OnPreviewCreated() { _scrollableOffscreen = new ScrollableOffscreen(this); _inputMethod = CanvasContext.GetInputMethod(); var jsFontInfo = _textView._settings.fonts.jpFont; _inputMethod.SetFont(jsFontInfo.name, jsFontInfo.height * _textView.ZoomRate, _textView.GetLineHeight()); }
/// <summary> /// /// </summary> protected override void OnPreviewInitialize() { _textView = Tnc.GetParent <TextView>(); _mouseClickCounter = new MouseClickCounter(4); _textView.VScrollBar.SetMarks(new List <IMarker> { _marker }); Caret = new Caret(_textView); Caret.BlinkChanged += () => RequestRenderCurrentLine(); _textView.FontChanged += () => { var jsFontInfo = _textView._settings.fonts.jpFont; _inputMethod.SetFont(jsFontInfo.name, jsFontInfo.height * _textView.ZoomRate, _textView.GetLineHeight()); Caret.Update(); }; Doc.DocModified += OnDocumentModified; }