INNER CODE UNIT · Dart

target

reqable/re-editor · lib/src/_code_field.dart:710

      final double target = max(0, _verticalViewport.pixels + offset.dy - size.height / 2);
      scrollViewport(_verticalViewport, target);
    } else if (offset.dy > size.height - _preferredLineHeight - paddingBottom) {
      final double target = min(
        _verticalViewportSize!,
        _verticalViewport.pixels + offset.dy + _preferredLineHeight - size.height / 2,
      );
      scrollViewport(_verticalViewport, target);
    }

    if (_horizontalViewport != null) {
      if (offset.dx < 0) {
        final target = max(0, _horizontalViewport!.pixels + offset.dx - size.width / 2);
        scrollViewport(_horizontalViewport!, target);
      } else if (offset.dx > size.width - _preferredLineHeight) {
        final target = min(
          _horizontalViewportSize!,
          _horizontalViewport!.pixels + offset.dx + _preferredLineHeight - size.width / 2,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…