File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,6 @@ - (SCSelectionView *)selectionView
9292{
9393 if (_selectionView == nil ) {
9494 _selectionView = [[SCSelectionView alloc ] init ];
95- [_selectionView setAutoresizingMask: NSViewMinXMargin | NSViewMaxXMargin | NSViewWidthSizable | NSViewHeightSizable | NSViewMinYMargin | NSViewMaxYMargin];
9695 // [_selectionView setShouldInverseColors:YES];
9796 [self .textView addSubview: _selectionView];
9897 }
@@ -169,7 +168,18 @@ - (void)updateTextView
169168 [mutableAttributedString release ];
170169}
171170
171+ - (void )resizeWithOldSuperviewSize : (NSSize )oldSize
172+ {
173+ [super resizeWithOldSuperviewSize: oldSize];
174+ [self updateSelectionViewAnimated: YES ];
175+ }
176+
172177- (void )updateSelectionView
178+ {
179+ [self updateSelectionViewAnimated: NO ];
180+ }
181+
182+ - (void )updateSelectionViewAnimated : (BOOL )animated
173183{
174184 if ([self isHidden ]) {
175185 return ;
@@ -195,7 +205,11 @@ - (void)updateSelectionView
195205 selectionViewFrame.origin .y = self.editorScrollView .contentView .bounds .origin .y * ratio;
196206 }
197207
198- self.selectionView .frame = selectionViewFrame;
208+ if (animated) {
209+ [self .selectionView.animator setFrame: selectionViewFrame];
210+ } else {
211+ [self .selectionView setFrame: selectionViewFrame];
212+ }
199213}
200214
201215#pragma mark - NSLayoutManagerDelegate
You can’t perform that action at this time.
0 commit comments